'py' is not recognized as an internal or external command, operable program or batch file

When i try to use the py command I get ‘py’ is not recognized as an internal or external command,
operable program or batch file. and I have put in in the environments and I have installed it for all users as well and it wont work

py.exe is a Windows specific feature.

Are you using python on Windows?

yes i am using windows 11

Where did you install python from? All the python.org installers add py.exe I though.
Do you install for “all users” or just yourself?

1 Like

all users i also tried just my self and it did not work and all users did not work either

i also got it from python.org

Are you saying it failed to install? Did the install give you errors?

If you have administrator ability install for all users.

I see C:\windows\py.exe is installed and that python is installed in C:\Program Files\Python312.

If you check these locations do you see the python files?

yes C:\windows\py.exe opens a command prompt with python and C:\Program Files\Python312 bings me to my python files but the py command still doesn’t work

Can you go into the command prompt and make sure that just executing py -0 results in this error? In the image you posted before you did some other operation. If it does error, what if you do “C:\Windows\py.exe -0”?

i got the error in command prompt and got this in windows.py
image

Run py.exe from the CMD.exe prompt, not from the python >>> prompt.

thats what i have been doing and the py command does not work

Did you use dir in CMD.exe to check if the paths I posted exist?
What did you find?

But you posted a screen shot show you did not run from CMD.exe prompt.

1 Like

You typed .py not py Remove the dot.


My bad with adding the . this is what it says now

Suggest you uninstall all versions of python.
Then install python 3.12 for all users taking all default options.
Do not turn off anything that is selected.
Try the py command again.

do i just hit the control panel to uninstall it or do I have to delete somekind of settings folder