pip
配置依赖包镜像源
默认情况下pip使用的是国外的镜像,下载速度比较慢,
可以通过配置切换成国内的镜像源(如清华源),提高下载速度
1
| $ pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
国内其他镜像源
1 2 3 4 5 6 7 8 9 10
| $ pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
$ pip config set global.index-url http://mirrors.myhuaweicloud.com/pypi/web/simple
$ pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
$ pip config set global.index-url http://pypi.douban.com/simple
$ pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple
|
安装指定包
1 2 3 4 5 6
| $ pip install numpy
$ pip install numpy==0.12.0
$ pip install numpy>=0.12.0
|
升级包
1
| $ pip install --upgrade numpy
|
卸载包
列出已安装的包
查看可升级的包
导出项目依赖包
1 2
| (pylearn) $ pip freeze > requirements.txt
|
使用requirements.txt安装所有依赖包
1
| $ pip install -r requirements.txt
|