Why Ubuntu doesn’t support certain form of shebang for Python?

Rodney Dawes rodney.dawes at canonical.com
Tue Nov 11 18:04:38 UTC 2014

On Tue, 2014-11-11 at 18:02 +0100, GatoLoko wrote:
> Since different distributions and unix systems may have different paths, 
> you may want to use the env utility in a shebang like "#!/usr/bin/env 
> python2".

Using /usr/bin/env will cause problems in certain conditions, such as
when running under a virtualenv and other such environments.

Also, for python 2.x scripts, you should always use /usr/bin/python, and
if python3 is required, /usr/bin/python3. There is no guarantee that
"python2" will be a valid command.

More information about the Ubuntu-devel-discuss mailing list