簡體   English   中英

Python、Windows:術語“conda”未被識別為 cmdlet 的名稱

[英]Python, Windows: The term 'conda' is not recognized as the name of a cmdlet

我遇到了 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

Previously I had installed anaconda and vs code to work in python but later I uninstalled anaconda and downloaded python3 from https://www.python.org/downloads/ .

我在 Path 中添加了 Python 的環境變量,但在 Powershell 中仍然出現此錯誤。

如何解決這個問題?

卸載任何其他 python 解釋器安裝並重新啟動以刷新環境變量

這里下載 Anaconda 安裝程序

如果你想在 Anaconda Navigator 之外使用它,你應該將它添加到 PATH 中,我建議你以管理員權限在系統范圍內安裝它

安裝畫面

安裝 2

這應該將 conda 可執行文件添加到 PATH 允許在系統范圍內調用它

我有同樣的問題。 我之前安裝了 anaconda 並在 Powershell 中運行終端命令“conda init”。 目前,在我卸載 conda 並安裝 miniconda 后,當我打開終端 window 時,PowerShell 總是顯示“The term 'E:\Anaconda\Install\Scripts\conda.exe' is not Recognized as the name of a cmdlet”。 我意識到它可能與命令“conda init”有關。

我想您可以刪除文件“C:\Users\hp\Documents\WindowsPowerShell\profile.ps”或使用您正在使用的正確文件路徑(例如:.....\conda.exe)修改它現在。 我寧願刪除它並再次輸入“conda init”。

兩種方法對我也有效。 在該文件中,它包含我在第二次安裝時更改的錯誤文件路徑。

我沒有興趣弄清楚命令“conda init”和 PowerShell 引導方式之間的關系。 有人可以向我們解釋嗎? 我會很感激的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM