http://blog.topspeedsnail.com/archives/526
这里整理一下几种解决方法:
一、增大延迟,加大超时时间:原文出处: https://blog.csdn.net/lijiang1991/article/details/51775896
方法一:pip --default-timeout=100 install -U pip
方法二:
1. 到https://pypi.python.org/simple/pip/下载最新的.whl文件(如pip-8.1.2-py2.py3-none-any.whl,注意:列表并非按发布时间排序,自己按文件名找到最新.whl文件)
2. 下载完之后,在终端下用pip安装: pip install (path)/pip-8.1.2-py2.py3-none-any.whl
二、国外镜像通常比较慢,可以使用第三源提高速度:
原文出处:
mkdir ~/.pip
vim ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
note:if aliyun not have the mirror you want ,you can change to these,but you need to change the green part simultaneously:
中国科技大学:http://pypi.mirrors.ustc.edu.cn/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣:http://pypi.douban.com/simple