pip是python的包管理工具(npm是不是直接抄的py啊233)娩鹉,Python 3.4 及后續(xù)版本已經(jīng)默認安裝了pip
查看pip版本:
pip --version
查看已安裝的包
pip freeze
安裝包
pip install xxx
安裝指定版本的包
pip install xxx==版本號
卸載包
pip uninstall xxx
更新pip
python -m pip install --upgrade pip
查看源
pip config list
修改源(windows):
在c盤你的用戶下(C:\Users\你的用戶名)下建立pip文件夾辩昆,然后在文件夾里新建pip.ini文件,用記事本打開,把以下內(nèi)容輸入保存即可(現(xiàn)在用的是清華大學的源):
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
附上常用的鏡像源:
阿里云
http://mirrors.aliyun.com/pypi/simple/
清華大學
https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣
http://pypi.douban.com/simple
中國科技大學
https://pypi.mirrors.ustc.edu.cn/simple/
中國科學技術(shù)大學
http://pypi.mirrors.ustc.edu.cn/simple/