Python Is Not Recognized Windows 10

Python Is Not Recognized Windows 10

I recently installed Python 3.6.3 on my device. When I type python in my cmd, 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.

2

11 Answers

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 python directly from the folder.

cd %LOCALAPPDATA%\Programs\Python\Python310
python --version

This should print the python 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 as pip

After adding the path to the System PATH variable, make sure you close and re-open any command prompts so they use the updated PATH.

2

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 there a python.exe file 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, then uncheck the aliases for python.exe and python3.exe. More information here

4

If still not working, as mentioned above in the answers, then simply move up the path, as shown in the screenshot.

2

you get this error because the python.exe path has not been added to the System environment variable to do that simply

  1. go to the path C:\Users\%Username%\AppData\Local\Programs\Python\Python37-32 which contains python.exe

  2. copy the path and open system environment variables and in the variable section look for variable called Path if not create new variable with Variable Name as Path and value as the copied path

  1. once you do that close the window and simply open cmd and type python you should get something like this

All the answers on StackOverflow about it were obsolete so 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.

4

If you are working with command prompt and if you are facing the issue even after adding python path to system variable PATH.

Remember to restart the command prompt (cmde.exe).

If you are trying to install new python version python-3.9.6 then click the checkbox of Add Python 3.9 to PATH

This happens because the path doesn't exist in environment variables. To fix this :

  1. Re-run the installer
  2. Choose Modify
  3. In optional feature click "Next"
  4. In advanced option tick the "Add Python to environment variables"
  5. Install

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.

For Python 3.6 there are actually 2 path entries. Also it's best to use the %USERPROFILE% rather then hard coding it.

%USERPROFILE%\AppData\Local\Programs\Python\Python36 %USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts

2

Just Set The Path Variable Correctly As Follows- Go To The Properties Of ThisPc Click Advanced System Settings Click Environment Variables... In System Variables Edit The Path Variable To

C:\Users\Username\AppData\Local\Programs\Python\Python36-32

Note That, Everyone May have Different UserName.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.