【问题标题】:Python, Windows: The term 'conda' is not recognized as the name of a cmdletPython、Windows:术语“conda”未被识别为 cmdlet 的名称
【发布时间】:2021-06-24 13:43:16
【问题描述】:

我在使用 Windows 10 Powershell 时遇到问题。每当我打开它时,都会出现错误:

& : The term 'C:\Users\hp\anaconda3\Scripts\conda.exe' 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 C:\Users\hp\Documents\WindowsPowerShell\profile.ps1:4 char:4
+ (& "C:\Users\hp\anaconda3\Scripts\conda.exe" "shell.powershell" "hook ...
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\hp\anaconda3\Scripts\conda.exe:String) [], CommandNotFoundExce
   ption
    + FullyQualifiedErrorId : CommandNotFoundException

之前我安装了 anaconda 和 vs 代码以在 python 中工作,但后来我卸载了 anaconda 并从 https://www.python.org/downloads/ 下载了 python3。

我在 Path 中添加了 Python 的环境变量,但在 Powershell 中仍然出现此错误。

如何解决这个问题?

【问题讨论】:

  • 等等,你需要 conda 还是常规的 python 解释器,或者两者都需要?
  • 我需要一个 python 解释器。
  • 如果您可以根据您的用例在 conda 和 python 之间做出选择,我可以帮助您设置其中之一
  • 我的大部分工作都与数据分析和构建机器学习和深度学习模型有关,我是第一次使用 vs code,你能建议 conda 和 python 哪个更好吗? @dopewind
  • 对于机器学习,我绝对会推荐 conda,因为它有许多专门为机器学习构建的 Python 内置库。

标签: python windows powershell visual-studio-code anaconda


【解决方案1】:

卸载任何其他 python 解释器安装并重新启动以刷新环境变量

here下载 Anaconda 安装程序

如果你想在 Anaconda Navigator 之外使用它,你应该将它添加到 PATH 中,我建议你使用管理员权限在系统范围内安装它

这应该将 conda 可执行文件添加到 PATH 允许在系统范围内调用它

【讨论】:

    猜你喜欢
    • 2019-10-12
    • 2023-01-28
    • 2017-12-11
    • 2021-12-09
    • 2020-02-25
    • 2020-04-17
    • 2018-09-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多