安裝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)