基于pip install django失败时的解决方法

使用pip安装Django时报错,先是:

C:\Users\admin>pip install django 
Collecting django 
 Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/django/ 
 Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:733: The handshake operation timed out',))': /simple/django/ 
 Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('timed out',))': /simple/django/ 

之后开始下载后没多少就直接报错退出了,可以用下面的方法换源下载:

pip install -i https://pypi.douban.com/simple django 

下载速度很快,成功!

以上这篇基于pip install django失败时的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持呐喊教程。

声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:notice#nhooo.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。