[python] Conda command is not recognized on Windows 10

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.

This question is related to python python-3.x windows-10 anaconda conda

The answer is


case #1 You should set 3 path:

%ANACONDAPATH%;
%ANACONDAPATH%\Scripts;
%ANACONDAPATH%\Library\bin;

It will solve problem:

C:\WINDOWS\system32>conda update conda
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/msys2/noarch/repodata.json.bz2>
Elapsed: -
...

case #2 Also you can use Anaconda Promd (for Win10) instead CLI (cmd.exe)


To prevent having further issues with SSL you should add all those to Path :

 SETX PATH "%PATH%;C:\<path>\Anaconda3;C:\<path>\Anaconda3\Scripts;C:\<path>\Anaconda3\Library\bin"

Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website


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

enter image description here

Next, you can add Python and Conda to your path by using the setx command in your command prompt. enter image description here

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


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

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.

enter image description here


You need to add the python.exe in C://.../Anaconda3 installation file as well as C://.../Anaconda3/Scripts to PATH.

First go to your installation directory, in my case it is installed in C://Users/user/Anaconda3 and shift+right click and press "Open command window here" or it might be "Open powershell here", if it is powershell, just write cmd and hit enter to run command window. Then run the following command setx PATH %cd%

Then go to C://Users/user/Anaconda3/Scripts and open the command window there as above, then run the same command "setx PATH %cd%"


If you have installed Visual studio 2017 (profressional)

The install location:

C:\ProgramData\Anaconda3\Scripts

If you do not want the hassle of putting this in your path environment variable on windows and restarting you can run it by simply:

C:\>"C:\ProgramData\Anaconda3\Scripts\conda.exe" update qt pyqt

I had also faced the same problem just an hour back. I was trying to install QuTip Quantum Toolbox in Python Unfortunately, I didn't stumble onto this page in time. Say you have downloaded Anaconda installer and run it until the end. Naively, I opened the command prompt in windows 10 and proceded to type the following commands as given in the qutip installation docs.

conda create -n qutip-env

conda config --append channels conda-forge

conda install qutip

But as soon as I typed the first line I got the following response

conda is not recognized as an internal or external command, operable program or batch file

error messsage

I went ahead and tried some other things as seen in this figures error message Finally after going through a number conda websites, I understood how one fixes this problem. Type Anaconda prompt in the search bar at the bottom like this (same place where you hail Cortana) Anaconda prompt

Once you are here all the conda commands will work as usual


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 normal cmd.exe and a 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.

Anaconda installation options on Windows

  1. If Anaconda is installed for the current use only, add %USERPROFILE%\Anaconda3\condabin (I mean condabin, not Scripts) into the environment variable PATH (the user one). If Anaconda is installed for all users on your machine, add C:\ProgramData\Anaconda3\condabin into PATH.

    How do I set system environment variables on Windows?

  2. 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 from conda init –help We’re especially excited about this new way of working, because removing the need to modify PATH 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


Even I got the same problem when I've first installed Anaconda. It said 'conda' command not found.

So I've just setup two values[added two new paths of Anaconda] system environment variables in the PATH variable which are: C:\Users\mshas\Anaconda2\ & C:\Users\mshas\Anaconda2\Scripts

Lot of people forgot to add the second variable which is "Scripts" just add that then 'conda' command works.


Examples related to python

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

Examples related to python-3.x

Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation Replace specific text with a redacted version using Python Upgrade to python 3.8 using conda "Permission Denied" trying to run Python on Windows 10 Python: 'ModuleNotFoundError' when trying to import module from imported package What is the meaning of "Failed building wheel for X" in pip install? How to downgrade python from 3.7 to 3.6 I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? Iterating over arrays in Python 3 How to upgrade Python version to 3.7?

Examples related to windows-10

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" How to install OpenSSL in windows 10? Anaconda Installed but Cannot Launch Navigator Conda command is not recognized on Windows 10 Copy Files from Windows to the Ubuntu Subsystem Hyper-V: Create shared folder between host and guest with internal network Why Local Users and Groups is missing in Computer Management on Windows 10 Home? VMware Workstation and Device/Credential Guard are not compatible pip not working in Python Installation in Windows 10 Copy Paste in Bash on Ubuntu on Windows

Examples related to anaconda

Upgrade to python 3.8 using conda Updating Anaconda fails: Environment Not Writable Error Jupyter Notebook not saving: '_xsrf' argument missing from post Conda version pip install -r requirements.txt --target ./lib How to check python anaconda version installed on Windows 10 PC? Anaconda / Python: Change Anaconda Prompt User Path How to access Anaconda command prompt in Windows 10 (64-bit) Conda activate not working? update to python 3.7 using anaconda Tensorflow import error: No module named 'tensorflow'

Examples related to conda

Upgrade to python 3.8 using conda How do I prevent Conda from activating the base environment by default? Conda version pip install -r requirements.txt --target ./lib Removing Conda environment PackagesNotFoundError: The following packages are not available from current channels: Conda activate not working? ModuleNotFoundError: No module named 'sklearn' How do I update Anaconda? Conda command is not recognized on Windows 10 'Conda' is not recognized as internal or external command