[Distutils] Package in both setup_requires and install_requires will not be installed

Michael Hoffman b3i4old02 at sneakemail.com
Tue Sep 18 01:42:06 CEST 2007

Michael Hoffman wrote:

> If you specify a package in setup_requires it will be built in the 
> current directory. But even if it is in install_requires as well, it 
> won't be installed because the requirement is already satisfied at setup 
> time by the package in the build directory.

I came up with this workaround:

from setuptools.command.install import install

class SubprocessEasyInstall(install):
     def run(self):

         args = [sys.executable, "-m", "easy_install"] + setup_requires

And in the setup() call, ensure you include:


This will easy_install the setup_requires in a separate process which is 
unpolluted by the distributions already downloaded during setup.

More information about the Distutils-SIG mailing list