Python中pip的使用以及更改下載源

基本命令

顯示版本信息

pip -V

安裝指定包

pip install <packages>
pip install -i 'host' <packages> 指定下載源

卸載指定包

pip uninstall <packages>

列出已安裝的包

pip list

顯示有關已安裝包的信息

pip show <packages>

查找指定包

pip search

修改下載源

Linux

 vim ~/.pip/pip.conf #編輯用戶目錄下隱藏的配置文件,沒有的話生成一個

格式如下:

[global]
index-url = https://pypi.tuna.tsinghua.ed...
[install]
trusted-host=mirrors.aliyun.com

國內源
清華:https://pypi.tuna.tsinghua.ed...

阿里雲:http://mirrors.aliyun.com/pyp...

中國科技大學 https://pypi.mirrors.ustc.edu...

華中理工大學:http://pypi.hustunique.com/

山東理工大學:http://pypi.sdutlinux.org/

豆瓣:http://pypi.douban.com/simple/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章