Winodws10 Command Prompt unresponsive to .py commands

Barry barry at barrys-emacs.org
Wed Mar 8 02:46:51 EST 2023



> On 8 Mar 2023, at 05:55, Mike Dewhirst <miked at dewhirst.com.au> wrote:
> 
> On 8/03/2023 6:31 am, Thomas Gregg wrote:
>> Hi,  I got python 11 to work with the esptool a few days ago.  However, I
>> must have something wrong, because now, when I enter any command with .py,
>> Windows Command Prompt just returns without doing anything.  Example
>> 
>> C:\Users\gregg>esptool.py version
>> 
>> C:\Users\gregg>
>> 
>> I tried to change the Windows default by filetype. but no luck.  Any
>> ideas?  Thanks
> 
> Prove it works in the command prompt by using the full path to python for example,
> 
> C:\Python311\python C:\Users\gregg>esptool.py version

On windows use the py.exe command rather then python.exe.

Does `py esptool.py version’
> 
> If that works, look at your path environment variables and see where python is sitting. Substitute the real location of Python 3.11 on your machine. Sadly, I think it defaults to C:\Program Files nowadays.
> 
> Once you can get Python working by omitting the path, for example,
> 
> C:\Users\gregg>python esptool.py version
> 
> ... you can then right-click the .py file and choose whichever program you like to open with.

Use py.exe which should in the windows folder to run .py files.

Barry

> I'm inclined to advise you to focus on getting virtual environments working next and leave all that auto-opening to later. You might find you prefer to right click and select every time.
> 
> M
> 
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Your
> email software can handle signing.
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list