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.