Conda command is not recognized on Windows 10
Solution 1
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
.
Solution 2
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
. -
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
Solution 3
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
Solution 4
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.
Solution 5
If you want to use Anaconda in regular cmd on windows you need to add several paths to your Path env variable.
Those paths are (instead of Anaconda3 the folder may be Anaconda2 depending on the Anaconda version on your PC):
\Users\YOUR_USER\Anaconda3
\Users\YOUR_USER\Anaconda3\Library\mingw-w64\bin
\Users\YOUR_USER\Anaconda3\Library\usr\bin
\Users\YOUR_USER\Anaconda3\Library\bin
\Users\YOUR_USER\Anaconda3\Scripts
\Users\YOUR_USER\Anaconda3\bin
Related videos on Youtube
alex
Updated on July 08, 2022Comments
-
alex almost 2 years
I installed Anaconda 4.4.0 (Python 3.6 version) on Windows 10 by following the instructions here: https://www.continuum.io/downloads. However, when I open the Command prompt window and try to write
conda list
I get the
'conda' command is not recognized...
error.
I tried to run
set PATH=%PATH%;C:\Users\Alex\Anaconda3
but it didn't help. I also read that I might need to edit my
.bashrc
file, but I don't know how to access this file, and how I should edit it.-
ramesh almost 7 yearsIn Windows 10, set path using Environmental variable
-
alex almost 7 years@ramesh, thanks for your comment. In the link that you game, the following comment appears: " This method is only applicable to accounts from Administrators group. It is not possible to change environment variables of a regular User level account using this method". Unfortunately I am not in the Administrators group, so I cannot use this method. Is there some other way to do that? Thanks!
-
Eric J. about 6 yearsNames of some programs seem to have changed in Anaconda 5.1. I was trying to set up Jupyter as an Anaconda novice and found that the instructions for 5.0 didn't work for 5.1. Rolled back to 5.0 and got things to work. Specifically, I couldn't locate conda and "jupyter notebook" seems to have changed to "jupyter-notebook." Not sure what else may have changed.
-
bjd2385 over 5 yearsIn Windows 10, I simply ran the following:
PATH=%PATH%;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Scripts
-
Eduardo Pignatelli about 5 yearsIf you installed anaconda jsut for your user, in windows 10 anaconda is in C:\Users\%USERNAME%\AppData\Local\Continuum\anaconda3. I added both the root path and the root/Scripts/ folder to the PATH, works fine.
-
Jimbo over 4 yearsThe Anaconda installer recommends against adding Anaconda to your path. When I did I couldn't get
conda
to work due to openssl not being found. Instead they recommend using Anaconda Prompt (see answer below).
-
-
alex almost 7 yearsthanks for your reply. I added C:\Users\Alex\Anaconda3 to the path in System variables, but conda command is still not recognized. I also wrote "C:\Users\Alex>set PATH=%PATH%;C:\Users\Alex\Anaconda3" in my command prompt window, but it didn't work either. Am I doing something wrong?
-
mjoppich almost 7 yearsSorry, did not notice there's also
C:\Anaconda3\Scripts`in my Path ... In the Scripts subfolder you should also manually find a
conda.exe` . -
alex almost 7 yearsThanks. What should I do after I find it? add it to the path as well?
-
mjoppich almost 7 yearsYup, add the folder to the path (sorry If I wasn't clear enough about that).
-
IvanD over 6 yearsI installed Anaconda for all users on my Windows 10, so it ended up in path: C:\ProgramData\Anaconda3. I had to add the following in my path for conda to work: C:\ProgramData\Anaconda3\Scripts.
-
zhihong over 6 yearsHi, thanks. after install anaconda, "Close" the terminal (I use ubuntu bash in windows 10) and open a new one, which means restart the system in Ubuntu dose the trick!
-
Nima Mousavi over 6 years@mjoppich but if the conda.exe does not get install for some reason? I do not have a conda.exe in my scripts folder. What to do?
-
john ktejik over 4 yearswhy does the latest installer say do NOT add conda to PATH?
-
mjoppich over 4 yearsBecause you are supposed to work in environments. These kind of have their own $PATH variable. Adding all the conda binaries to the global system may hide sytem binaries, etc. Nonetheless, advanced users may know what they are doing and still add it to their PATH.
-
Rob Prouse over 4 yearsThanks, by far the best answer. I didn't want to add Python and everything else to my path, I wanted to follow best practices and use Virtual Environments which all the other answers mess up.
-
niid about 4 yearsThis is the correct answer in 2020 and by far the cleanest way to handle conda environments & paths. Also note, if you use git-bash(mingw), msys(2), or cygwin you have to run
\path\to\anaconda3\Scripts\conda.exe init bash
instead. -
Rauni Lillemets about 4 yearsThings have been changed after conda 4.6. See the answer by Simba below.
-
alexpghayes over 3 yearsTo revert this, I presume I can reset PATH and call
conda init
again? -
SumakuTension over 2 yearsYou might have to refresh the environment variables afterwards. run 'set PATH=C' , and then close and restart the command window
-
quasipolynomial about 2 yearsYou also need C:\Anaconda3\Library\bin.
-
jdunning about 2 yearsNote that if you installed Miniconda instead of Anaconda, you'll need to add
%USERPROFILE%\miniconda3\condabin
to yourPATH
. -
Akaisteph7 almost 2 yearsInstead of "a new Powershell", I specifically had to run
conda init
in an "Anaconda Powershell Prompt".