使用pip安装软件包时,出现ReadTimeoutError,查找资料发现是因为pip下载默认使用国外的源,换成国内的源下载会大大提高下载速度。
错误如下:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
解决方法:使用国内源
清华:https://pypi.tuna.tsinghua.edu.cn/simple/ (亲测超快)
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
操作方法:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxxx #包名