【问题标题】:Display conda enviroment in vscode terminal在 vscode 终端中显示 conda 环境
【发布时间】:2021-10-02 17:10:22
【问题描述】:

我正在尝试在 vs-code 下设置 conda 环境。我已经设置了python interpreter,不幸的是,vscode terminal 中没有环境指示

你知道如何修复它并正确配置它吗?

谢谢。

【问题讨论】:

    标签: visual-studio-code terminal anaconda


    【解决方案1】:

    感谢您帮助我,这里是所有过程修复:

    应用命令:

    conda init Powershell

    然后关注Fix Error PS1 Can Not Be Loaded Because Running Scripts Is Disabled

    1. set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    2. Get-ExecutionPolicy

    我确实在 vs-code 终端有correct output :)

    【讨论】:

      【解决方案2】:

      在您可以使用之前激活您的环境非常重要。如果您的终端没有显示环境前缀,只需尝试再次启动终端。如果您也安装了 coderunner 扩展,这尤其是一个问题。

      如果这没有帮助,请尝试

      conda init powershell
      

      然后重启终端。

      【讨论】:

      • conda init powershell 之后出现错误消息:: 文件 C:\Documents\WindowsPowerShell\profile.ps1 无法加载,因为在此系统上禁用了运行脚本。有关详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=135170 上的 about_Execution_Policies。在 line:1 char:3 + 。 'C:\Documents\WindowsPowerShell\profile.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
      • 所以,如果我的回答有助于解决问题,请不要忘记接受/投票以奖励自愿帮助。这就是 StackOverflow 的工作原理。
      猜你喜欢
      • 2021-10-02
      • 2019-04-30
      • 2019-03-07
      • 2021-12-18
      • 1970-01-01
      • 2018-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多