1 下载好Twisted后,进入到下载目录,解压: 2 [root@codebreaker ~]#tar -jvxf Twisted-8.1.0.tar.bz2 3 解压完成后进入相应目录: 4 [root@codebreaker ~]#cd Twisted-8.1.0 5 执行安装: 6 [root@codebreaker Twisted-8.1.0]#python setup.py install 7 安装完成后进入python,测试Twisted是否安装成功 8 [root@codebreaker Twisted-8.1.0]# python 9 Python 2.5 (r25:51908, May 26 2008, 17:47:47) 10 [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 11 Type "help", "copyright", "credits" or "license" for more information. 12 >>> import twisted 13 >>> 14 如果没有错误发生,说明Twisted已经安装成功了
如果提示:ImportError: No module named setuptools 执行如下:
1 wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz 2 tar zxvf setuptools-0.6c11.tar.gz 3 cd setuptools-0.6c11 4 python setup.py build 5 python setup.py install
1 [root@codebreaker ~]#tar -zvxf pyOpenSSL-0.7.tar.gz 2 [root@codebreaker ~]#cd pyOpenSSL-0.7 3 [root@codebreaker pyOpenSSL-0.7]#python setup.py install
3、测试是否安装成功
1 [root@codebreaker ~]# python 2 Python 2.5 (r25:51908, May 26 2008, 17:47:47) 3 [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 4 Type "help", "copyright", "credits" or "license" for more information. 5 >>> import OpenSSL 6 >>> import twisted.internet.ssl 7 >>> twisted.internet.ssl 8 <module 'twisted.internet.ssl' from '/usr/python/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-linux-i686.egg/twisted/internet/ssl.pyc'> 9 如果出现类似提示,说明pyOpenSSL模块已经安装成功了,否则,请检查上面的安装过程。
[root@codebreaker ~]#tar -zvxf pycrypto-2.0.1.tar.tar [root@codebreaker ~]#cd pycrypto-2.0.1 [root@codebreaker pycrypto-2.0.1]#python setup.py install
3、测试是否安装成功
[root@codebreaker ~]# python Python 2.5 (r25:51908, May 26 2008, 17:47:47) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Crypto >>> import twisted.conch.ssh.transport >>> print Crypto.PublicKey.RSA <module 'Crypto.PublicKey.RSA' from '/usr/python/lib/python2.5/site-packages/Crypto/PublicKey/RSA.pyc'> >>> 提示RSA.pyc位置,说明已经安装成功了。