尝试在VS代码上使用Conda时出错:Conda:术语Conda无法识别为cmdlet的名称

问题描述

我正在尝试构建一个基本的机器学习算法,为此,我使用了Python的蟒蛇解释器。然而,即使visual studio代码似乎已经将conda识别为解释器,并且我让anaconda3 shell作为单独的应用程序工作,我也无法让conda处理VS代码。每当我尝试检查CONDA时,都会收到以下错误:

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

我已尝试了此处链接的修复程序:'Conda' is not recognized as internal or external command

然而,它们对我并不起作用。我尝试将Conda设置为我的路径,但仍然收到相同的错误。提前感谢!


解决方案

尝试以下操作:

  1. 运行Anaconda/Miniconda
  2. 激活那里的环境:
conda activate your-env
  1. 从蟒蛇/Miniconda终端启动Visual Studio代码:
code

则Visual Studio代码应识别conda

相关文章