[Distutils] Making setuptools play nicer with virtualenv

Gael Varoquaux gael.varoquaux at normalesup.org
Wed Apr 2 11:43:09 CEST 2008


Hi,

I have just out-clevered myself using setuptools and virtualenv:

 * install foo using "python setup.py develop" (foo being ipython).

 * download some module bar you want to work on in an isolated environment

 * create this isolated environment using "virtualenv bar"

 * in the isolated environment "python setup.py develop" the bar module.

 * still in the isolated environment, try to import bar in a script
   installed by foo (aka ipython)

    --> fails because foo uses the system python, and virtualenv wants
	you to use its own python

One very easy solution to make this work is to have the setuptools
generated scripts use, under unices, "#!/usr/bin/env python" rather than
"#!/usr/bin/python". This seems to me like a good solution, in general,
to follow the user's expectations.

Is this a change that would be possible?

Cheers,

Gaël



More information about the Distutils-SIG mailing list