Thanks for the response.
I followed the instructions to the letter, located the Python executable at
and pasted it in and did everything else as instructed. No luck, command prompt still can’t find Python.
You have to update your windows PATH variable to add 3 directories. Just add this to the end of your path: c:\users\chuck\AppData\Local\Programs\Python\Python312\;c:\users\chuck\AppData\Local\Programs\Python\Python312\Lib;c:\users\chuck\AppData\Local\Programs\Python\Python312\Scripts
I had to add all 3 dirs to get PIP and the modules to work correctly.
Fix your path with a custom autoexec.bat
I also have a DOS cmd shortcut which puts me in my Python projects dir, and calls a custom c:\apps\autoexec.bat file.
In the shortcut this goes in the Target field: C:\Windows\System32\cmd.exe /k c:\apps\autoexec.bat
This will launch cmd.exe and execute the autoexec.bat file and stay in the cmd window.
My partial autoexec.bat file also sets up the PYTHONPATH just in case.
Fix your path in Windows system config
Go to Control Panel.
Search for “path” without the double quotes.
You should see something like “system” or “Edit the system environment variables”. Click that.
A window will pop up. Cick the Advanced tab.
On the bottom of the Advanced tab click “Environment variables” button.
Under the area “User variables for YOURUSER” click the entry for Path, then click Edit button.
Another window will pop up.
Click New and add 3 entries total, one for each path I put above. Windows will string them together for you.
Click OK. Click OK on Environment Variables.
Close the System Properties window.
In my c:\apps directory I also have the TED.exe editor, Tiny editor, which is very small, and super handy packed with features! Get it here: TED Notepad
In C:\Windows, like the documentation (last link I gave you) says. The entire point of it is that there is only one copy even if you install multiple versions of Python (so that it can find one for you), and that it’s in a place that will always be on PATH (so that your PATH doesn’t need to be modified).
You should not make your own wrapper for this, and the wrapper you show accomplishes nothing - you’re expecting Windows to look for it in the same place that you want it to find Python, using the same logic.
Yes, whenever python finds a Python interpreter, python without parameters gives you the interactive prompt for that interpreter. Similarly, py without parameters gives you the interactive prompt of whichever Python interpreter py finds. There is nothing version-specific about this (except that py hasn’t existed forever). py also has its own command-line options that control how it looks for Python, and then it forwards additional options to the Python that it finds.
Thank you. My path is not setup to look there. No wonder cmd.exe couldn’t find it. I’ll fix my path.
Cool! I see you made an edit and your post updated automagically. This is great forum software!
EDIT: I meant that when I open a cmd.exe prompt, I run an autoexec.bat file which sets the path and c:\windows is not in that particular path. I wonder if this overrides the user and system path variables. My c:\windows was in the SYSTEM path variable, but not my user path variable until I added it.
That can’t possibly be right. If your PATH does not include C:\Windows already then I should expect multiple things to go wrong while trying to boot the computer. (You should be aware that there are separate system- and user-level settings for PATH.)