Adding python to windows path not working
Solution 1
What am I doing incorrectly here?
You are not saving your changes correctly.
Look at the bottom of the dialog where you are editing. There are OK and Cancel buttons. Press OK. Then OK on the next dialog, etc ... it should be a total of 3 times:
After you have done this open a new cmd
prompt and your modified path should show when you type path
.
Solution 2
Adding for future reference, as I struggled with this same problem for a while and none of the suggested solutions here or elsewhere fixed the issue for me.
If you have WindowsApps in your path variable then you want to make it is below your Python directory in the list. The reason is WindowsApps contains a python.exe, but it isn't actually python, just a hook to launch Windows Store and search for Python. If WindowsApps appears first in your path variable then Windows will try to use this when you run python from cmd
, rather than the python.exe in the directory you have pointed to.
Solution 3
1) get rid of the trailing backslash (notice none of the other entries has one) 2) make sure you open a new command prompt after making changes.
Solution 4
Make sure to keep up your python above your windows apps.
Related videos on Youtube
Alec Rhea
"Every triangle is a love triangle when you love triangles." -Pythagoras
Updated on September 18, 2022Comments
-
Alec Rhea over 1 year
After following the instructions on the answer to this quetion, my computer still doesn't recognize python as an internal or external command, operable program or batch file.
I've uploaded a picture for context; what am I doing incorrectly here?
EDIT: Here is another picture to show that I am inside path, but the issue seems to be that it won't save the changes I'm making. I copy the correct line in and press enter then press okay, but it's gone when I pull it back up.
-
DavidPostill almost 6 yearsComments are not for extended discussion; this conversation has been moved to chat.
-
-
Alec Rhea almost 6 yearsThank you, but I deleted the trailing backslash on the top entry if that's what you meant and opened a new command prompt and it still doesn't recognize python as a command.
-
Bill Hileman almost 6 yearsNavigate to the folder and confirm that the location exists. If the command to start python is "python" you could also locate it from your command prompt by typing
dir python.exe /s
-
Alec Rhea almost 6 yearsThat yields the following:
C:\Users\alecj>dir python.exe /s Volume in drive C is Windows Volume Serial Number is 5875-E6CD Directory of C:\Users\alecj\AppData\Local\Programs\Python\Python37-32 06/27/2018 04:08 AM 97,432 python.exe 1 File(s) 97,432 bytes Directory of C:\Users\alecj\PycharmProjects\test\venv\Scripts 07/01/2018 01:33 AM 97,432 python.exe 1 File(s) 97,432 bytes Total Files Listed: 2 File(s) 194,864 bytes 0 Dir(s) 91,200,049,152 bytes free
-
Alec Rhea almost 6 yearsIs the answer buried in there somewhere? I'm not sure what you mean by 'navigate to the folder', but I copied the string I put in path directly from file explorer.
-
Bill Hileman almost 6 yearsYes, as @DavidPostill mentioned above, you need to specifically add
C:\Users\alecj\AppData\Local\Programs\Python\Python37-32
to your path -
Bill Hileman almost 6 yearsI'm not sure what your original screen capture is of, but it doesn't appear to be your path.
-
Alec Rhea almost 6 yearsI've uploaded another screenshot to show that it is my path, but the changes won't save for some reason.
-
Bill Hileman almost 6 yearsInstead of editing the path in User variables change the one in System variables.
-
ex28 over 2 yearsThis resolved the issue I was having.
-
schlingel about 2 yearsYes, this is important because there is another python executable under WindowsApps dir which opens the Windows Store and then does nothing. Thanks!