anaconda - path environment variable in windows

PythonWindowsEnvironment VariablesAnaconda

Python Problem Overview

I am trying to run python from the windows command prompt (windows 10). So the result is the typical one when the path environment variable is not configured

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

however, I am not sure which is the right directory I should set up in the path variable.

I tried a few variations, and none of them work, including:


and none of them works.

Does anyone have experience with this particular system constellation (windows, anaconda). Thanks.

Python Solutions

Solution 1 - Python

it turns out I was mistaken.

Solution is: in anaconda (as well as in other implementations), set the path environment variable to the directory where 'python.exe' is installed.

As a default, the python.exe file in anaconda is in:


after you do that, obviously, the python command works, in my case, yielding the following.

Python 3.4.3 |Anaconda 2.2.0. (64|bit)|(default, Nov 7 2015), etc, etc

Solution 2 - Python

Instead of giving the path following way:


Do this:


Solution 3 - Python

The default location for python.exe should be here: c:\users\xxx\anaconda3 One solution to find where it is, is to open the Anaconda Prompt then execute:

> where python

This will return the absolute path of locations of python eg:

(base) C:\>where python

Solution 4 - Python


I just added above path , to my path environment variables and it worked. Now, all we have to do is to move to the .py script location directory, open the cmd with that location and run to see the output.

Solution 5 - Python


For me this was the default installation directory on Windows 7. Found it via Rusy's answer

Solution 6 - Python

In windows 10 you can find it here:


Solution 7 - Python

To export the exact set of paths used by Anaconda, use the command echo %PATH% in Anaconda Prompt. This is needed to avoid problems with certain libraries such as SSL.


Solution 8 - Python

You can also run conda init as below,

C:\ProgramData\Anaconda3\Scripts\conda init cmd.exe


C:\ProgramData\Anaconda3\Scripts\conda init powershell

Note that the execution policy of powershell must be set, e.g. using Set-ExecutionPolicy Unrestricted.

Solution 9 - Python

I want to mention that in some win 10 systems, Microsoft pre-installed a python. Thus, in order to invoke the python installed in the anaconda, you should adjust the order of the environment variable to ensure that the anaconda has a higher priority.


Solution 10 - Python

You could also just re-install Anaconda, and tick the option add variable to Path.. This will prevent you from making mistakes when editing environment variables. If you make mistakes here, your operating system could start malfunctioning.

Solution 11 - Python

Provide the Directory/Folder path where python.exe is available in Anaconda folder like


This should must work.

Solution 12 - Python

Try path env var for system (on windows)

C:\ ...\Anaconda3\

C:\ ...\Anaconda3\scripts

C:\ ...\Anaconda3\Library\bin

Must solve! It worked for me.


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlejandro SimkievichView Question on Stackoverflow
Solution 1 - PythonAlejandro SimkievichView Answer on Stackoverflow
Solution 2 - PythonKAMLESH KARKIView Answer on Stackoverflow
Solution 3 - PythonChad Hamilton FrederickView Answer on Stackoverflow
Solution 4 - PythonPiyush UpadhyayView Answer on Stackoverflow
Solution 5 - PythonfivefView Answer on Stackoverflow
Solution 6 - PythonArman FatahiView Answer on Stackoverflow
Solution 7 - PythonprusswanView Answer on Stackoverflow
Solution 8 - PythonMattView Answer on Stackoverflow
Solution 9 - PythonzhenlingcnView Answer on Stackoverflow
Solution 10 - PythonPsychotechnopathView Answer on Stackoverflow
Solution 11 - PythonSunil SinghView Answer on Stackoverflow
Solution 12 - PythonBigumangabaView Answer on Stackoverflow