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

Barry barry at barrys-emacs.org
Fri Dec 22 08:13:18 EST 2023



> On 22 Dec 2023, at 12:39, Sibylle Koczian via Python-list <python-list at python.org> wrote:
> 
> Hello,
> 
> I always install Python on Windows in the same manner:
> 
> - Python is not on the path,
> - it is installed for all users,
> - the Python Launcher is installed for all users,
> - the file types .py, .pyw etc. are associated with Python.
> 
> My shebang line is usually "#!/usr/bin/env python3".
> 
> This has always worked well. I could run Python scripts in a console
> window entering just the script name, by double clicking in the explorer
> or using WIN+r; the two last variants for GUI or for scripts with
> something like "input('Leave with Enter')" at the end.
> 
> Now I've got a new computer with Windows 11 and I've installed Python
> 3.12.1. On my older machine it's Windows 10 and Python 3.11.5. Reading
> the Python documentation it seems my shebang lines should work as before
> - but they don't. The error message:
> 
> "Unable to create process using 'C:\usr\bin\env\python
> "C:\Eigen\Src\launcher_versuche.py" ': Das System kann die angegebene
> Datei nicht finden."
> 
> Without the "env" in the shebang line and only without it everything
> works as expected - but that's contrary to the documentation, isn't it?

This suggests a typo in the shebang line. Is there a space between env and python?

Barry


> 
> Thank you for information,
> Sibylle
> --
> https://mail.python.org/mailman/listinfo/python-list
> 



More information about the Python-list mailing list