5

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?enter image description 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.

Alec Rhea
  • 207

5 Answers5

15

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.

5

Make sure to keep up your python above your windows apps.

Example

MMM
  • 2,778
1

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.

  • Thank 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. – Alec Rhea Jul 05 '18 at 20:15
  • Navigate 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 – Bill Hileman Jul 05 '18 at 20:18
  • That 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 Jul 05 '18 at 20:22
  • Is 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. – Alec Rhea Jul 05 '18 at 20:22
  • Yes, as @DavidPostill mentioned above, you need to specifically add C:\Users\alecj\AppData\Local\Programs\Python\Python37-32 to your path – Bill Hileman Jul 05 '18 at 20:26
  • I'm not sure what your original screen capture is of, but it doesn't appear to be your path. – Bill Hileman Jul 05 '18 at 20:28
  • I've uploaded another screenshot to show that it is my path, but the changes won't save for some reason. – Alec Rhea Jul 05 '18 at 20:40
  • Instead of editing the path in User variables change the one in System variables. – Bill Hileman Jul 05 '18 at 22:29
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:

enter image description here

After you have done this open a new cmd prompt and your modified path should show when you type path.

DavidPostill
  • 156,873
0

Just in case changing the order of your path variables didn't fix the issue (it didn't for me) there is a really obscure setting in

Settings -> Apps -> Advanced app settings -> App execution aliases

I needed to also disable python.exe and python3.exe from here to.

Screenshot of settings

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Dec 13 '23 at 14:45