[Twisted-Python] Twisted+setuptools fun ;-)

Brian Granger ellisonbg.net at gmail.com
Fri Apr 11 17:51:19 EDT 2008

Now that twisted is easy_installable, I am adding code to our
(ipython1's) setup.py script to declare Twisted as a dependency:

# Declare dependencies only if setuptools is being used
if 'setuptools' in sys.modules:
    setup_args["install_requires"] = [

This is simple enough.  But, it doesn't quite work:

[in ipython1 source directory]
> python setup.py install
Processing dependencies for ipython1==0.3alpha1
Searching for Twisted>=8.0.1
Reading http://pypi.python.org/simple/Twisted/
Reading http://twistedmatrix.com/
Reading http://www.twistedmatrix.com
Reading http://twistedmatrix.com/products/download
Reading http://twistedmatrix.com/projects/core/
Best match: Twisted 8.0.1
Downloading http://tmrc.mit.edu/mirror/twisted/Twisted/8.0/Twisted-8.0.1.tar.bz2
Processing Twisted-8.0.1.tar.bz2
Running Twisted-8.0.1/setup.py -q bdist_egg --dist-dir
error: Setup script exited with twisted.python.dist module not found.
Make sure you have installed the Twisted core package before
attempting to install any other Twisted projects.

This message comes from the setup.py scripts in the individual
projects.  They all start with:

    from twisted.python import dist
except ImportError:
    raise SystemExit("twisted.python.dist module not found.  Make sure you "
                     "have installed the Twisted core package before "
                     "attempting to install any other Twisted projects.")

The odd thing is that if I simply easy_install Twisted, all works fine:

> easy_install Twisted
... everything works as expected.

I know that other projects are started to declare their Twisted deps
this way.  Are other people running into this?



More information about the Twisted-Python mailing list