Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

Thomas Passin list1 at tompassin.net
Tue Jan 2 12:24:05 EST 2024


On 1/2/2024 11:56 AM, Mats Wichmann via Python-list wrote:
> On 1/1/24 12:53, Thomas Passin via Python-list wrote:
> 
>> On Windows 10, a shebang line gets ignored in favor of Python 3.9.9 
>> (if invoked by the script name alone) or Python 3.12.1 (if invoked by 
>> the "py" launcher).
> 
> fwiw, you can also create an ini file to define to the launcher py which 
> version should be the default, if no version is specified.

You might learn about this if you happen to read and remember the right 
part of the Python docs.  Otherwise you have no idea what py.exe is up 
to nor how it does it.  I would say that most people don't know there's 
an ini file, let alone what it can do.  Of course this situation isn't 
unique to py.exe!



More information about the Python-list mailing list