python-twisted在win下的安装
1.下载页面:
http://twistedmatrix.com/trac/wiki/Downloads
https://launchpad.net/pyopenssl
https://www.dlitz.net/software/pycrypto/?
?
准备好工具
安装工具:http://pypi.python.org/pypi/setuptools
安装完成后在
D:\Python26\Scripts文件夹中找到easy_install.exe
把蛋拖进去
?
或者:
?
如果已经把egg文件下载到了本地,则easy_install xxx.egg就ok了,如何有依赖,则会自动下载安装,省心了。如果没有下载下来,网络安装更爽,直接 easy_install 包名,此时喝点咖啡休息一下,回过神来时已经安装好了。唯一一点不好的感觉是,easy_install现在还不支持自动卸载,网上流传的用easy_install -m xxx来卸载,是不行了,这个命令式用来安装同一个包的多个版本的
2.安装
1)download the twisted,then install the twisted windows "sumo"
2)download and install pyopenssl
3)download and install pycrypto
4)verify:
python
>>>import twisted
如果没有发生错误,则表示成功
?
安装pycrypto时可能会提示错误:
Unable to find vcvarsall.bat
解决方法是(前提是必须安mingw,假设mingw安在D:\CodeBlocks\中)
首先:
set path=D:\CodeBlocks\MinGW;D:\CodeBlocks\MinGW\bin;%path%
然后:
再
python setup.py? build --compiler=mingw32
最后:
python setup.py? install
?
还需要在这里下载安装pyasn1
http://sourceforge.net/projects/pyasn1/
?
?
?3.从源代码安装
$ tar -xjvf ~/downloads/TwistedSumo-2005-03-22.tar.bz2
??? TwistedSumo-2005-03-22/
??? TwistedSumo-2005-03-22/bin/
??? ...
??? TwistedSumo-2005-03-22/README
??? TwistedSumo-2005-03-22/LICENSE
??? TwistedSumo-2005-03-22/setup.py
??? TwistedSumo-2005-03-22/ZopeInterface-3.0.1.tgz
import twisted >>>
?
import OpenSSL >>> import twisted.internet.ssl >>> twisted.internet.ssl.SSL <module 'OpenSSL.SSL' from '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/OpenSSL/SSL.so'>
?
import Crypto >>> import twisted.conch.ssh.transport >>> twisted.conch.ssh.transport.RSA <module 'Crypto.PublicKey.RSA' from '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/Crypto/PublicKey/RSA.pyc'>
?
And that's it! You've installed PyCrypto from source. At this point you have a complete, working Twisted installation, including support for SSL and SSH connections.
?