安裝和使用python的setup tools

來源:互聯網
上載者:User
安裝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)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.