skip down to the 3 comments

Installing Python’s Twisted on CentOS5 x86_64

I had to do a bit of searching to find the correct way to install Twisted on a 64 bit CentOS 5 machine, like the one I have via virtual hosting with SliceHost. But once I had the answers it was very actually very simple, so this should save you the same headache.

I was having an import problem with Twisted’s subpackages, and was also initially having a problem building the lib from source. The first problem was caused by the fact that 64 bit CentOS installs things in both /usr/lib and /usr/lib64 which confuses Twisted, as it expects things in the same directory. The final problems was due to me trying to compile Twisted without the python-devel lib and the Twisted Zope Interfaces which is a dependancy.

So to install, run these commands:

$ sudo yum install python-devel python-crypto pyOpenSSL zope
$ mkdir src;cd src
$ wget http://tmrc.mit.edu/mirror/twisted/Twisted/8.1/Twisted-8.1.0.tar.bz2
$ tar jxvf Twisted-8.1.0.tar.bz2
$ cd Twisted-8.1.0
$ sudo python setup.py install --install-lib /usr/lib64/python2.4

Bingo, and you should now be able to test with:

$ python
...
>>> import twisted
>>> import twisted.web

The lines above should give you no output.

There have been 3 responses to this post.

  1. Malcolm

    Thank you for taking the time to document this, helped me immensely when setting up local test vm on CentOS 5.3 i386. The installation of dependencies is not very well covered on the Twisted site, i used the following commands:

    sudo yum install python-devel python-crypto pyOpenSSL zope

    [navigate to uncompressed twisted folder, in my case Twisted-8.2.0]

    sudo python setup.py install

    I will try this on my SliceHost too.

  2. Jonathan Mark

    I also thank you for this helpful article.

  3. Krut

    Thanks man..Installation of Python Twisted worked on CentOS 5.
    Kudos!!


back to the top