pip升级Connection to files.pythonhosted.org timed out

执行如下语句的时候报错:

pip install --upgrade pip 

具体报错如下:

Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/77/41/706fc9525f195a41b89718cdb7b36bd2e1cbf448842699e80152befe00a5/Active-SQLAlchemy-0.4.0.tar.gz (Caused by ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f71f789ccc0>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)'))

解决方法:

pip install --upgrade pip -i https://mirrors.bfsu.edu.cn/pypi/web/simple/

也可以自己找其他源,建议找https的源地址,否则可能会报如下错误:

The repository located at mirrors.bfsu.edu.cn is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.mirrors.ustc.edu.cn'.

おすすめ

転載: blog.csdn.net/cocos2dGirl/article/details/119150787
おすすめ