I recently installed Python 3.6.3 on my device. When I type python
in my cmd window, it gives me this error. I do have the PATH in the environment variables. Path Lists. This should normally fix it, but python
is still not recognized.

- 30,738
- 21
- 105
- 131

- 425
- 1
- 4
- 14
10 Answers
I had the same problem, due to a stupid decision from Microsoft.
I had another line in my system path variable:
C:\Users\MyUserName\AppData\Local\Microsoft\WindowsApps
And Windows 10 put a python.exe
file there that only redirected me to the Python page of the Microsoft Store:
Since this line was above my true Python path, typing python
in the cmd prompt opened the Microsoft Store...
Solution:
Type App execution aliases
in the Windows 10 search bar, and then uncheck the aliases for python.exe
and python3.exe
. More information is here.

- 30,738
- 21
- 105
- 131

- 10,614
- 1
- 17
- 33
-
1Just tested the alias settings - no effect in Win11 Pro 22000.708 - gets forcefully re-enabled the same nanosecond you turn it off (both python.exe and python3.exe, but not any others). Works on Win10 Pro without issue, even without Python installed at all. – Tadas S May 28 '22 at 12:12
-
My exact same problem. I was going nuts trying to figure it out, thanks for posting it. Note, for me only this worked, not changing path priorities or moving paths around as others have suggested. – Andrew Holmgren Jun 10 '22 at 14:19
-
1@afk5min I had the same problem on Win10. Turns out you need to close all the apps and programs that use Python. For me it was PyCharm. After that, re-enabling went away – George Zorikov Mar 03 '23 at 18:14
The path to the Python executable needs to be in the System PATH variable. Note this is not the User PATH variable.
The OP had Python 3.6.3 installed in C:\Python\Python36-32
, however a common default location for installation is in the users AppData\Local\Programs\
folder. This post will assume a Python 3.10 installation in this location. Please adjust as needed for your current Python version and path.
You can confirm the path from the command prompt by checking the Python executable directly from the folder.
cd %LOCALAPPDATA%\Programs\Python\Python310
python --version
This should print the Python interpreter version. For example, Python 3.10.4
.
Add the following entries to the System PATH:
%LOCALAPPDATA%\Programs\Python\Python310
for the python executable%LOCALAPPDATA%\Programs\Python\Python310\Scripts
for tools such aspip
After adding the path to the System PATH variable, make sure you close and reopen any command prompts, so they use the updated PATH.

- 30,738
- 21
- 105
- 131

- 694
- 5
- 8
-
-
5In your screenshot, you see an `Edit environment variable` window. Behind that in the screenshot is the `Environment Variables` window which is divided into two sections. The top section is the `User` section. The bottom section is the `System` section. Edit the `PATH` variable in the `System` section. – Brian M. Sheldon Dec 07 '17 at 17:25
If it is still not working, as mentioned in the previous answers, then simply move up the path, as shown in the screenshot.

- 30,738
- 21
- 105
- 131

- 1,371
- 1
- 13
- 30
You get this error, because the python.exe path has not been added to the System environment variable. To do that, simply:
go to the path
C:\Users\%Username%\AppData\Local\Programs\Python\Python37-32
which contains python.execopy the path and open System environment variables and in the variable section look for variable called Path. If not, create a new variable with Variable Name as Path and value as the copied path
Once you do that, close the window and simply open cmd. Type
python
and you should get something like this:

- 30,738
- 21
- 105
- 131

- 17,235
- 8
- 110
- 131
If you are trying to install the new Python version, python-3.9.6
, then click the checkbox of Add Python 3.9 to PATH

- 30,738
- 21
- 105
- 131

- 14,355
- 2
- 10
- 20
This happens because the path doesn't exist in environment variables.
To fix this:
- Rerun the installer
- Choose Modify
- In optional feature click "Next"
- In advanced option tick the "Add Python to environment variables"
- Install

- 30,738
- 21
- 105
- 131

- 31
- 3
All the answers on Stack Overflow_ about it were obsolete, so I decided to add this. The path variable that needs to be added is,
C:\Users\Username\AppData\Local\Programs\Python\Python36-32
Note that everyone may have a different Username.

- 30,738
- 21
- 105
- 131
-
This depends on the location the user chooses to install python. The accepted answer used the OPs install location. – Brian M. Sheldon May 27 '18 at 17:37
-
-
-
This answer helped me; I had unknowingly installed python in this directory instead of the usual directory – Novastorm Jul 29 '19 at 10:00
If you are working with the command prompt and if you are facing the issue even after adding the Python path to system variable PATH:
Remember to restart the command prompt (cmde.exe).

- 30,738
- 21
- 105
- 131

- 149
- 2
- 3
I too was struggling with this issue, and everything was configured correctly. I installed and setup my system path variables as one would. And everything was fine. Then upon reboot windows would not recognize 'python' as a command as if it were unaware of the path variable. Double checked to confirm everything was still setup correctly (it was).
It only started to work again after I manually browsed to the directory in which python.exe existed, and ran 'python'. After that windows seemed to recognize my path variable and I could call 'python' from where ever need be. Very odd. Figured I'd share in case someone else runs into this.

- 2,389
- 4
- 30
- 61
For Python 3.6, there are actually two path entries. Also, it's best to use the %USERPROFILE% rather than hard coding it.
%USERPROFILE%\AppData\Local\Programs\Python\Python36 %USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts

- 30,738
- 21
- 105
- 131
-
1%USERPROFILE% only applies if that's where you are installing. This would not work for custom paths. The OP had python installed in c:\Python\Python36-32 – Brian M. Sheldon May 27 '18 at 17:27
-
Guys I still cannot get this to install on my new W10 Pro -- will recognize a (broken) pip, not python. I hate Windows. – Zach Oakes Nov 04 '19 at 17:40