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. I need help.
-
Make sure the program is installed at to that location. Mine is in C:ProgramData\ – kaminsknator Nov 28 '17 at 19:28
-
It is. I double checked that. – Rishabh Mandayam Dec 1 '17 at 17:05
Make sure the path is in your System PATH variable and not in a User PATH variable. After adding the path to the PATH variable, make sure you close and re-open any command prompts so they use the updated PATH.
You should also confirm the path by checking python directly from the folder.
The example below is for the OP's path.
Make sure you use the path specific to your installation:
%USERPROFILE%\AppData\Local\Programs\Python\Python36
%USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts
for access to tools such as PIP
%USERPROFILE%\AppData\Local\Programs\Python\Launcher
cd c:\Python\Python36-32 python --version
or using CMD or Powershell on Windows: \>Python --version
should print Python 3.x.x
where x = version specific numbers.
-
-
3In your screenshot, you see an
Edit environment variable
window. Behind that in the screenshot is theEnvironment Variables
window which is divided into two sections. The top section is theUser
section. The bottom section is theSystem
section. Edit thePATH
variable in theSystem
section. – Brian M. Sheldon Dec 7 '17 at 17:25
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.
-
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
-
I agree with you. – user379888 May 28 '18 at 17:02
-
-
This answer helped me; I had unknowingly installed python in this directory instead of the usual directory – Novastorm Jul 29 '19 at 10:00
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 new variable with Variable Name as Path and value as the copied path
- once you do that close the window and simply open cmd and type python you should get something like this
If still not working, as mentioned above in the answers, then simply move up the path, as shown in the screenshot.
-
1
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).
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
-
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 4 '19 at 17:40
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.
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.