python is not recognized windows 10

Viewed 67128

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.

11 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 there a python.exe file that only redirected me to the python page of the Microsoft Store: enter image description here

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

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

image here

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

enter image description here

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

enter image description here

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

enter image description here

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

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.

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).

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.

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.

Related