(轉)pip和easy_install使用方式

來源:互聯網
上載者:User

標籤:style   http   color   使用   html   管理   

easy_install 跟 pip 都是 Python 的套件管理程式,有了它們,在使用 Python 開發程式的時候會帶來不少方便。

easy_install 和 pip 有什麼不一樣?據 pip  官網的說法,pip 改善了不少 easy_install 的缺點,如此說來 pip 應該是略勝一籌,不過它還不能夠完全取代對方,因為目前有很多套件還是得用 easy_install 安裝。

底下說明如何在 Windows 上安裝與使用 easy_install 與 pip,我假設你系統上已經安裝了 Python。

easy_install 的安裝與使用

連到底下的網址下載 setuptools,根據你的 Python 環境使用適合的版本 :

http://pypi.python.org/pypi/setuptools

例如我在 Windows 上跑 Python 2.7,所以我下載 setuptools-0.6c11.win32-py2.7.exe 回來安裝。安裝程式會把  easy_install 裝到 Python 的 Scripts 資料夾下 (例如 C:\Python27\Scripts),安裝好之後,建議你把 Scripts 資料夾加到 PATH 環境變數裏。

easy_install 安裝與移除套件的基本使用方式如下:

安裝套件:

easy_install PackageName

更新套件:

easy_install -U PackageName

移除套件:

easy_install -m PackageName

顯示說明:

easy_install --showhelp

pip (pip installs packages) 的安裝與使用

pip 的安裝方法:

easy_install pip

有趣的是,pip 可以透過 easy_install 安裝,而且也會裝到 Scripts 資料夾下。

安裝套件:

pip install PackageName

更新套件:

pip install -U PackageName

移除套件:

pip uninstall PackageName

搜尋套件:

pip search PackageName

顯示說明:

pip help

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.