Re: Fwd: Re: Use of "python" shebang an installation error?

"Thomas Kluyver" <[email protected]> Wed, 22 Jul 2020 11:40:06 +0100
Newsgroups gmane.comp.python.distutils.devel
Message-ID <[email protected]>
On Tue, 21 Jul 2020, at 21:50, David Mathog wrote:
> ./lib/python3.6/site-packages/pip/_vendor/appdirs.py:#!/usr/bin/env python

Python packaging tools like pip generally differentiate between *scripts*, which are installed to be run from the command line, and *modules*, which are imported from other Python code. Files under site-packages are modules. Any special handling for shebangs, execute bits, or Windows .exe wrappers is usually done only for scripts.

It's not unusual to see a shebang in modules - I think some editors put it in whenever you create a new Python file. But it doesn't usually do anything. If you want to run a module directly, the normal way now is with "python -m", which doesn't use the shebang.

Thomas
--
Distutils-SIG mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/distutils-sig.python.org/
Message archived at https://mail.python.org/archives/list/[email protected]/message/HPTRB3S55WNAOUEHLQTWD2QDG5BL3HM6/