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

Michael Torrie torriem at gmail.com
Fri Dec 22 19:21:50 EST 2023


On 12/22/23 11:42, Thomas Passin via Python-list wrote:
> There is some important context that is missing here.  Python on Windows 
> does not normally install to that location.  That is not even a Windows 
> path, neither by directory name nor by path separators.

No, that's just the way the py launcher on Windows has always worked in
the past. This way you can take a script from a nix system and drop it
in Windows and it has half a chance of running through the launcher,
from Windows explorer, or by running py myscript.py at the command
propmpt.  The Py launcher essentially ignores (or used to ignore) the
path in the shebang and focuses on what version of Python it should fire
up.


More information about the Python-list mailing list