[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: #!/usr/bin/python2.3 vs #!/usr/bin/env python2.3



On Tue, 2003-08-12 at 06:50, John Goerzen wrote:
> Hello,
> 
> Many Python programs use constructs like #!/usr/bin/env python2.3 to load
> themselves.  Many others use #!/usr/bin/python2.3.  On most Debian systems,
> these are the same.
> 
> The submitter in #189473 claims that #!/usr/bin/env python2.3 is wrong
> because he has his own python2.3 on the path prior to the system's, and it
> doesn't necessarily have requisite libraries for the programs being run.

The submitter is basically right. There have been discussions about this
on this list in the past. However, the python policy has the following;

     Programs that can run with any version of Python should be started
     with `#!/usr/bin/python'.  They must also specify a dependency on
     `python'.  You're free to use `#!/usr/bin/env python', if you'd
like
     to give the user a chance to override the Debian Python package
with a
     local version.
 
and;

     Programs which require a specific version of Python must start with
     `#!/usr/bin/python<X>.<Y>'.  They must also specify a dependency on
     `python<X>.<Y>'.  Again, if you're using `#!/usr/bin/env
     python<X>.<Y>', please be aware that a user might override the
Debian
     Python package with a local version.
 
Despite the Python Policy allowing you to use #!/usr/bin/env, the
general consensus is that it is a bad idea. Package maintainers who
choose to use it must be prepared to justify their decision and deal
with bug reports from users with broken local installations of python.


-- 
Donovan Baarda <abo@minkirri.apana.org.au>
http://minkirri.apana.org.au/~abo/



Reply to: