python 自動安裝工具 setuptools(easy_install) 的使用


1.下載安裝 python 安裝工具,下載地址:http://pypi.python.org/pypi/setuptools ,可以找到正確的版本進行下載。
2.解壓縮后雙擊 ez_setup.py 進行安裝,相關文件將自動安裝至當前 python 版本的 scripts 目錄下,如:C:\Python27\Scripts 。(或在 cmd 下執行 python ez_setup.py ,即可自動安裝 setuptools )。

3.安裝 python 模塊時,首先 cmd 進入
C:\Python27\Scripts 目錄,執行安裝命令,如安裝 phonenumbers 模塊時執行 " easy_install phonenumbers " 命令即可。

以下內容為轉載,原文地址:http://bu-choreography.iteye.com/blog/1113059

安裝easy_install完成之后,如何使用easy_install呢,去官網看看吧:--Downloading and Installing a Package 

使用一: 
       根據你想要的安裝包名來進行easy_install,工具會檢索網頁查詢最新版本的包,自動下載、構建和安裝 
       easy_install SQLObject 
這辦法很簡潔並不適合中國國情,由於GFW對python.org的長期屏蔽,命令行下的easy_install根本找不到網址,更無從下載 
使用二: 
       指定網址來更新或安裝,類似使用一,多了個參數-f和用來指定頁面的地址 
只指定頁面地址 
       easy_install -f http://pythonpaste.org/package_index.html SQLObject 
使用三: 
       只使用網址來easy_install安裝 
       easy_install http://example.com/path/to/MyPackage-1.2.3.tgz 
使用四 
        easy_install安裝下載好的egg文件(egg文件是用setup tools打包的壓縮文件) 
        easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg 
使用五: 
         升級包,有時候你需要更新包的版本 
         easy_install --upgrade PyProtocols 
使用六: 
         我最喜歡的一種方法,翻*牆后下載安裝包並解壓,然后CD到解壓包內運行以下命令即可 
        easy_install . 

參考資料:http://peak.telecommunity.com/DevCenter/EasyInstall#downloading-and-installing-a-package


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM