[Distutils] setup.py script using python interpreter from previous run

Tarek Ziadé ziade.tarek at gmail.com
Tue Nov 9 12:07:36 CET 2010

On Tue, Nov 9, 2010 at 11:58 AM, Geoff Bache <geoff.bache at gmail.com> wrote:
> Hi all,
> I have the following setup.py script:
> #!/usr/bin/env python
> from distutils.core import setup
> scripts=["hello.py"]
> setup(scripts=scripts)
> I have two different python installations (using virtualenv) where I
> wish to install this program. So I do
> ~/tmp/test_setup/python1/bin/python setup.py install
> which creates a file at
> /users/geoff/tmp/test_setup/python1/bin/hello.py, that looks like
> this:
> #!/users/geoff/tmp/test_setup/python1/bin/python
> print "Hello"
> So far so good. But then I also install it somewhere else:
> ~/tmp/test_setup/python2/bin/python setup.py install
> which creates a file at
> /users/geoff/tmp/test_setup/python2/bin/hello.py which refers to
> "python1", i..e it has the same contents as the first one. Which is
> clearly not what I want.
> Is this a bug? Or have I missed something in my setup.py? It works of
> course if I remove the generated "build" directory by hand, but it's
> not so nice to have to remember to do that.

Can you add an issue in bugs.python.org please (using the "Distutils2"
component and "feature request")

This is a general problem we have in Distutils: update an existing
build if some of its elements are out of date.

We need to add some kind of replacement mechanism (not sure how yet).
This won't be fixed in Distutils 1, but we can change the behavior in

In the meantime, you should remove the build directory by hand or use
the "clean" command that does it for you in your call:

~/tmp/test_setup/python2/bin/python setup.py clean -a install

Sorry for the inconveniency

> (I'm using Python2.6 on Linux)
> Regards,
> Geoff Bache
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

Tarek Ziadé | http://ziade.org

More information about the Distutils-SIG mailing list