pip使用

pip是python的包管理工具(npm是不是直接抄的py啊233),Python 3.4 及后续版本已经默认安装了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文件,用记事本打开,把以下内容输入保存即可(现在用的是清华大学的源):

[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/
中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple/

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容