安装Twisted时需要装zope.interface模块,下载后发现是egg的,不知咋装,网上找发现setup tools。下面记录。
安装setup tools:
下载文件:ez_setup.py
然后使用2.6的解释器执行,这个脚本会自动在网上去下载相关的安装程序,然后就安装好了,安装完成后,会在scripts文件下生成几个exe可执行文件。
C:\>c:\Python26\python.exe ez_setup.py
Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-p
y2.6.egg
Processing setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to c:\python26\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to c:\Python26\Scripts
Installing easy_install.exe script to c:\Python26\Scripts
Installing easy_install.exe.manifest script to c:\Python26\Scripts
Installing easy_install-2.6-script.py script to c:\Python26\Scripts
Installing easy_install-2.6.exe script to c:\Python26\Scripts
Installing easy_install-2.6.exe.manifest script to c:\Python26\Scripts
Installed c:\python26\lib\site-packages\setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
使用 setuptools:
语法:easy_install.exe 你要安装的egg包
注意egg包不一定是扩展名是egg的,其实在linux里面是不区分扩展名的。后面的egg包也可以是网址的。如果你非常懒,像我jason懒羊羊那么懒的话,直接输入名称就可以了。比如你要安装Mechanize模块,只要输入:easy_install Mechanize 就可以啦,剩下来的工作setuptools会帮你搞定的。
下载zope.interface-3.6.1-py2.6-win32.egg放到C:\Python26\Scripts目录下,然后
C:\>cd Python26\Scripts
C:\Python26\Scripts>easy_install.exe zope.interface-3.6.1-py2.6-win32.egg
Processing zope.interface-3.6.1-py2.6-win32.egg
creating c:\python26\lib\site-packages\zope.interface-3.6.1-py2.6-win32.egg
Extracting zope.interface-3.6.1-py2.6-win32.egg to c:\python26\lib\site-packages
Adding zope.interface 3.6.1 to easy-install.pth file
Installed c:\python26\lib\site-packages\zope.interface-3.6.1-py2.6-win32.egg
Processing dependencies for zope.interface==3.6.1
Finished processing dependencies for zope.interface==3.6.1
C:\Python26\Scripts>
点这里下载附件(ez_setup.py)