[Distutils] Shebang lines, /usr/bin/python, and PEP394

Paul Moore p.f.moore at gmail.com
Fri Jul 26 21:38:51 CEST 2013


On 26 July 2013 20:32, Barry Warsaw <barry at python.org> wrote:

> I love `#!/usr/bin/env python` *for development* but I really think its a
> bad
> thing to have for installed scripts.  Certainly, for distro installed
> scripts,
> it's (usually) terrible.  I think virtualenv installs are generally in the
> same boat though - if you're installing a script into a virtualenv, it's
> better to rewrite the shebang to use the executable that was used to
> install
> it.
>

There are cases where it's useful and appropriate - the best example "in
the wild" is distil, which uses #!/usr/bin/env python to allow it to run
with "the current Python" specifically, so that it can be used to install
packages whatever Python you're using and without needing multiple copies
of the script installed. I've written similar types of scripts which
benefit in the same way from a /user/bin/env shebang line.

In fact, support for /usr/bin/env was added to the Windows launcher just
recently to provide precisely this functionality for scripts on Windows.

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130726/d7eee56e/attachment-0001.html>


More information about the Distutils-SIG mailing list