解决VS Code 运行 “conda : The term ‘conda‘ is not recognized as the name of a cmdlet, function, script “

今天开始学习 Panda, 第一个程序就运行报错了, 错误如下

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.

这是错误截图:

解决VS Code 运行 “conda : The term ‘conda‘ is not recognized as the name of a cmdlet, function, script “

大致意思就是说, CMD目前不能识别 conda这个命令, Win+R 打开CMD, 运行 conda, 发现果然无法识别, 应该就是安装了 Anaconda, 但是咱们的环境变量还没有配置, 所以会出现这个问题.

解决方法很简单, 把Anaconda的变量添加到系统环境中就好了, 但是这里要 注意的是, 我们需要添加的不是anaconda根目录下的 bin\ 目录, 而是 Scripts\目录.

解决步骤

  1. 找到 anaconda的安装路径, 我这里是 C:\Applications\anaconda3\Scripts
  2. 打开系统环境变量, 在 用户变量 或者 系统变量里 (两个都可以, 如果不想把系统变量弄乱, 就在用户变量里添加), 找到 Path, 双击打开, 然后添加一个新值, 内容为anaconda的Scripts目录的路径, 我这里是 C:\Applications\anaconda3\Scripts.解决VS Code 运行 “conda : The term ‘conda‘ is not recognized as the name of a cmdlet, function, script “
  3. 然后一路保存确定, 就可以了.

  4. 然后从CMD中测试 conda, 发现可以了!

Original: https://blog.csdn.net/Alaskyed/article/details/121280130
Author: Alaskyed
Title: 解决VS Code 运行 “conda : The term ‘conda‘ is not recognized as the name of a cmdlet, function, script “

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/770916/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球