[Distutils] shebang line modified by setuptools
cliff at develix.com
Sat Apr 12 18:58:28 CEST 2008
On Sat, 2008-04-12 at 12:19 -0400, Phillip J. Eby wrote:
> At 09:07 PM 4/11/2008 -0700, Cliff Wells wrote:
> >It seems the correct solution to this is to use "#!/usr/bin/env
> >python" (or rather, evaluate `which env` to account for some systems
> >which have /bin/env rather that /usr/bin/env) which allows the sys admin
> >to override the Python binary much more easily.
> No, it isn't the correct solution. The correct solution is to re-run
> easy_install on the target -- it will leave the existing installed
> code in place, but regenerate the scripts with headers pointing to
> the currently-in-use Python.
This is good to know, but still not as good as using env and the reason
is simple: every Unix user on the planet knows the env solution and what
it means if they see it in a script (they can override using PATH). The
same cannot be said for the above.
Unless I'm missing something, I can't see the advantage your way has
over the traditional way. I'll be glad to hear how I'm wrong.
> Even that is often not as good an idea as reinstalling for a new
> version of Python; some packages (notably, setuptools itself, but I
> have others) include different code and data depending on the Python
> version they are built for. For example, a package built for Python
> 2.5 might not include dependency specs for ctypes, sqlite, or
> wsgiref, but the same package might need to specify those
> dependencies on earlier versions of Python.
Absolutely. Except I was specifically *not* upgrading many
applications. Rather I wanted them to remain at 2.4. These are the
ones I had to change the shebang line for. Now I know I could have run
easy_install instead, but that information wasn't easily located at the
> By the way, please don't send me unsolicited private emails about
> setuptools unless you're a client or potential client. There's a
> reason that every single official web page about setuptools directs
> you to email the distutils-sig. I don't do private email for ANY of
> my open source projects, unless you're a client or looking to be
> one. Mailing lists have searchable archives, meaning that my time
> answering a question is being offset by its potential utility to a
> much larger audience. Thanks.
My apologies. The link for the mailing list on the page that covers
this on the peak site is quite small and follows a lot of text.
More information about the Distutils-SIG