pip安装库慢,使用镜像解决!!!

pip命令默认使用的是国外的pypi镜像(pypi.python.org),安装慢不说,
有时甚至会导致出现超时等网络问题,造成安装失败。
所以,使用国内的pypi镜像,不失为一种加速pip安装第三方包的好方法。国内的第三方镜像源有很多,
如下所示:
  阿里云镜像源:http://mirrors.aliyun.com/pypi/simple/
  中国科技大学镜像源: https://pypi.mirrors.ustc.edu.cn/simple/
  豆瓣镜像源: http://pypi.douban.com/simple/
  清华大学镜像源:https://pypi.tuna.tsinghua.edu.cn/simple/
  中国科学技术大学镜像源:http://pypi.mirrors.ustc.edu.cn/simple/
  如果要使用第三方镜像源,只需要在安装时,通过pip命令的-i选项指定镜像源即可,
例如:

pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/

复制链接:

 -i https://pypi.tuna.tsinghua.edu.cn/simple/

永久方法:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

你可能感兴趣的:(python,pip,python,开发语言)