【发布时间】:2021-11-10 22:48:45
【问题描述】:
我尝试在 Visual Studio 代码中使用 Anaconda 环境,并选择了 conda 环境作为解释器。 但是当我单击“在终端中运行 Python 文件”时,首先运行“conda activate base”命令。
PS C:path\to\workspace> conda activate base
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ conda activate base
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
但是我还没有将Anaconda环境添加到系统PATH,因为官网说它可能会导致问题。
所以我想知道有没有办法在不将 conda 环境添加到系统路径的情况下使用它?我知道我可以使用code path/to/workspace 在 Anaconda Prompt 中启动 vscode。但是我无法切换到 vscode 中的其他解释器。
【问题讨论】:
-
注意不要使用
base环境进行开发,会导致一堆问题。
标签: python visual-studio-code anaconda conda