#!/usr/bin/env python vs. #!/usr/bin/python

Grant Edwards grante at visi.com
Fri May 2 10:44:59 EDT 2008


On 2008-05-02, Jeroen Ruigrok van der Werven <asmodai at in-nomine.org> wrote:

>>I've never clearly understood why people want to use "#! /usr/bin/env
>>python", which is prone to finding a different Python from the one
>>installed by the operating system. I'd be interested to see what
>>responses are in favour of it, and what the reasoning is.
>
> Simple, some systems are not as peculiar as a lot of Linux boxes which
> chug everything into /usr/bin, which is OS territory

On many Linux distros, Python is pretty much part of the OS.
Since the early days of RedHat, Python has been part of the
base/minimum install since a lot of the "required" system
utilities were written in python.  In Redhat, the package
manger was originally written in Python, so Python had to be in
"OS territory".

> (as has been decreed long ago by hier(7)), but rather use
> /usr/local/bin (all BSD Unix and derivatives) or /opt or
> whatever convention a particular operating system has.

In the Linux world, /usr/local/bin and /opt are for stuff
installed by the user, not stuff that is an integral, required
part of the OS distribution.

-- 
Grant




More information about the Python-list mailing list