[Twisted-Python] Twisted and Centos5 install problems

Jean-Paul Calderone exarkun at divmod.com
Fri Feb 1 14:00:38 EST 2008

On Fri, 1 Feb 2008 13:34:15 -0500, Doug Farrell <dfarrell at mypublisher.com> wrote:
>Hello everyone,
>I'm trying to install Twisted 2.5 on a Centos 5 intel based server that
>has Python 2.4 on it, and am having problems. I download the Twisted 2.5
>tar file, unpack it, go to the zope.interface directory and perform a
>"sudo python setup.py install" command, which succeeds. I then go to the
>root directory and do the same thing for Twisted "sudo python setup.py
>install" and it looks like it completes successfully. When I go into the
>Python interpreter and enter an "import twisted" line, that works fine.
>However, if I do this, "from twisted import web" I get an error:
>Python 2.4.3 (#1, Mar 14 2007, 19:01:42)
>[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> from twisted import web
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>ImportError: cannot import name web
>When I look in /usr/lib/python2.4/site-packages/twisted I see that it
>has a web directory, so I'm not sure what's going on or what the problem
>is. Any insights would be most welcome!

Is this a 64 bit machine?  Do you also have /usr/lib64/python2.4/site-packages/twisted?  If so, it may be that Python is
picking that up, causing it to ignore anything in /usr/lib/python2.4/site-packages/twisted.

If so, the solution is to tell distutils to install all of Twisted in the
same place.  I forget the exact options to do this, you can probably find
them in the output of "python setup.py install --help".


More information about the Twisted-Python mailing list