简体   繁体   中英

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

I am facing an issue with the Windows 10 Powershell. Whenever I open it I get an error:

& : 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/ .

I have added the environment variables for Python in Path but still I get this error in the Powershell.

How to fix this?

Uninstall any other python interpreter installation and restart to refresh env variables

Download Anaconda Installer from here

You should add it to PATH if you want to use it outside of Anaconda Navigator and I recommend you install it systemwide with admin privilege

安装画面

安装 2

This should add conda executable to PATH allowing it to be called systemwide

I have the same issue. I'd installed anaconda previously and I run the terminal command 'conda init' in Powershell. At present, after I uninstall conda and install miniconda, PowerShell always shows 'The term 'E:\Anaconda\Install\Scripts\conda.exe' is not recognized as the name of a cmdlet' while I open a terminal window. I realize that it may be related to the command 'conda init'.

I guess you can delete the file 'C:\Users\hp\Documents\WindowsPowerShell\profile.ps' or modify it with a correct file path(eg:.....\conda.exe) that you're using right now. I'd rather delete it and type 'conda init' again.

Two ways work to me either. In the file, it contains an incorrect file path that I've changed at the second installation.

I have no interest in figuring out the relationship between command 'conda init' and PowerShell boot way. Are someone can explain this to us? I'll appreciate it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM