python 安裝多個包/pip用法

來源:互聯網
上載者:User

標籤:arc   word   pac   升級   UI   bsp   tin   不安裝   code   

列出已安裝的包

pip freeze or pip list

匯出requirements.txt

pip freeze > <目錄>/requirements.txt

安裝包線上安裝

pip install <包名> 或 pip install -r requirements.txt

通過使用== >= <= > <來指定版本,不寫則安裝最新版

requirements.txt內容格式為:

APScheduler==2.1.2Django==1.5.4MySQL-Connector-Python==2.0.1MySQL-python==1.2.3PIL==1.1.7South==1.0.2django-grappelli==2.6.3django-pagination==1.0.7
安裝本地安裝包

pip install <目錄>/<檔案名稱> 或 pip install --use-wheel --no-index --find-links=wheelhouse/ <包名>

<包名>前有空格

可簡寫為

pip install --no-index -f=<目錄>/ <包名>

卸載包

pip uninstall <包名> 或 pip uninstall -r requirements.txt

升級包

pip install -U <包名>

或:pip install <包名> --upgrade

升級pip

pip install -U pip

顯示包所在的目錄

pip show -f <包名>

搜尋包

pip search <搜尋索引鍵>

查詢可升級的包

pip list -o

下載包而不安裝

pip install <包名> -d <目錄> 或 pip install -d <目錄> -r requirements.txt

打包

pip wheel <包名>

更換國內pypi鏡像國內pypi鏡像
  • V2EX:pypi.v2ex.com/simple
  • 豆瓣:http://pypi.douban.com/simple
  • 中國科學技術大學:http://pypi.mirrors.ustc.edu.cn/simple/
指定單次安裝源

pip install <包名> -i http://pypi.v2ex.com/simple

指定全域安裝源

在unix和macos,設定檔為:$HOME/.pip/pip.conf
在windows上,設定檔為:%HOME%\pip\pip.ini

[global]timeout = 6000  index-url = http://pypi.douban.com/simple


參考來源:http://www.cnblogs.com/xueweihan/p/4981704.html

python 安裝多個包/pip用法

聯繫我們

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