Conda command is not recognized on Windows 10
In Windows, you will have to set the path to the location where you installed Anaconda3 to.
For me, I installed anaconda3 into C:\Anaconda3
. Therefore you need to add C:\Anaconda3
as well as C:\Anaconda3\Scripts\
to your path variable, e.g. set PATH=%PATH%;C:\Anaconda3;C:\Anaconda3\Scripts\
.
You can do this via powershell (see above, https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx ), or hit the windows
key → enter environment
→ choose from settings
→ edit environment variables for your account
→ select Path
variable → Edit
→ New
.
To test it, open a new dos shell, and you should be able to use conda commands now. E.g., try conda --version
.
Things have been changed after conda 4.6.
Programs "Anaconda Prompt" and "Anaconda Powershell" expose the command conda
for you automatically. Find them in your startup menu.
If you don't wanna use the prompts above and try to make conda
available in a standard cmd.exe
or a standard Powershell. Read the following content.
Expose conda
in Every Shell
The purpose of the following content is to make command conda
available both in cmd.exe
and Powershell on Windows.
If you have already checked "Add Anaconda to my PATH environment variable" during Anaconda installation, skip step 1.
-
If Anaconda is installed for the current use only, add
%USERPROFILE%\Anaconda3\condabin
(I meancondabin
, notScripts
) into the environment variablePATH
(the user one). If Anaconda is installed for all users on your machine, addC:\ProgramData\Anaconda3\condabin
intoPATH
.How do I set system environment variables on Windows?
-
Open a new Powershell, run the following command once to initialize
conda
.conda init
These steps make sure the conda
command is exposed into your cmd.exe
and Powershell.
Extended Reading: conda init
from Conda 4.6
Caveat: Add the new \path\to\anaconda3\condabin
but not \path\to\anaconda3\Scripts
into your PATH
. This is a big change introduced in conda
4.6.
Activation script initialization fron conda
4.6 release log
Conda 4.6 adds extensive initialization support so that more shells than ever before can use the new
conda activate
command. For more information, read the output fromconda init –help
We’re especially excited about this new way of working, because removing the need to modifyPATH
makes Conda much less disruptive to other software on your system.
In the old days, \path\to\anaconda3\Scripts
is the one to be put into your PATH
. It exposes command conda
and the default Python from "base" environment at the same time.
After conda
4.6, conda
related commands are separated into condabin
. This makes it possible to expose ONLY command conda
without activating the Python from "base" environment.
References
- Conda 4.6 Release
- How do I prevent Conda from activating the base environment?
When you install anaconda on windows now, it doesn't automatically add Python or Conda.
If you don’t know where your conda and/or python is, you type the following commands into your anaconda prompt
Next, you can add Python and Conda to your path by using the setx command in your command prompt.
Next close that command prompt and open a new one. Congrats you can now use conda and python
Source: https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444
The newest version of the Anaconda installer for Windows will also install a windows launcher for "Anaconda Prompt" and "Anaconda Powershell Prompt". If you use one of those instead of the regular windows cmd shell, the conda
command, python etc. should be available by default in this shell.