如何使用国内镜像源下载安装python中使用的库
使用镜像下载的会是安装的包的速度快很多,下面简单介绍使用pip命令下载所用的包,添加镜像下载的方法。
一、方法
例如:使用pip命令安装numpy库
pip install numpy
如果使用镜像的话,只需要在该命令后面添加 “-i + 镜像网址”即可,这里使用清华镜像源为例
即如下:
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
二、国内镜像源列表
1.清华:https://pypi.tuna.tsinghua.edu.cn/simple/
2.豆瓣:http://pypi.douban.com/simple/
3.阿里云:http://mirrors.aliyun.com/pypi/simple/
4.中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/