Paul Moore added the comment:

> - when inside a venv (almost always) go 'python' the old way, because 'py' is 
> unreliable here, *unless* you manually check the shebang of your scripts 
> before you execute them. 

No. When inside a venv:

- If you want to use the interactive interpreter, use 'py'.
- If you want to execute a script, use a shebang of #!/usr/bin/env python and 
then use `py myscript.py`

You should use /usr/bin/python[X[.Y]] shebangs specifically when you want to 
use the system Python, and bypass venvs. So that's typically for scripts you've 
installed in your PATH, not for working scripts in your project. You should 
never use versioned executable names in shebangs with /usr/bin/env.

Your issues seem to come from an insistence on using versioned interpreter 
names in /usr/bin/env shebangs, which does not work as you expect. (How it 
actually works is IMO not very helpful, but not easily fixable without shipping 
versioned executables, which is an entirely different debate which I don't 
intend to get into here).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28686>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to