distutils changes my scripts when installing (python 2.2)

Steve Holden sholden at holdenweb.com
Fri Mar 7 14:48:19 CET 2003

"Irmen de Jong" <irmen at -NOSPAM-REMOVE-THIS-xs4all.nl> wrote in message
news:3e67f6c2$0$49111$e4fe514c at news.xs4all.nl...
> Hello
> using distutils from python 2.2 changes my scripts that I want it to copy.
> Some of them start with:
> #! /bin/env python
> as the first line.
> Instead of just copying them, distutils copies and adjusts the
> first line to
> #! /usr/bin/python
> That is not terrible ofcourse but I didn't expect this.
> I read somewhere that using the #! /bin/env blabla  way of
> starting scripts on unix was preferable to directly calling
> the program that has to execute the script.
> But I don't know the reasons behind this.
> What do I lose by the change distutils decides to make for me?
> Can I somehow tell distutils not to make this change?

The major thing to realise here is that setup.py, being a Python program,
will normally set your programs up to use the same version of Python that
you used to run the setup itself. This is useful when (as discussed in
another thread recently) one has multiple copies of Python on a single

I like to test that new modules will install on Windows and Cygwin on my
laptop, even bfore I get them down into the basement for stress-testing :-)

I wouldn't worry too much as long as everything works: if you really have a
/usr/bin/python then it's quicker than using /bin/env python.

Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Register for PyCon now!            http://www.python.org/pycon/reg.html

More information about the Python-list mailing list