在python中安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))

本文讲述了在Python3中遇到Django安装问题,通过更换国内镜像源并解决安全警告,成功解决pip install Django的问题。作者分享了常用的国内pip源及解决步骤,关注IT技术人员面临的网络限制挑战。
摘要由CSDN通过智能技术生成

用python3 的pip install Django,死活就是安装不上,总是说出错,

PS D:\AutoTest\CloudDevTesting> pip install django
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1112: The handshake operation timed out'))': /simple/django/    
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1112: The handshake operation timed out'))': /simple/django/    
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1112: The handshake operation timed out'))': /simple/django/    
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1112: The handshake operation timed out'))': /simple/django/    
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1112: The handshake operation timed out'))': /simple/django/    
ERROR: Could not find a version that satisfies the requirement django (from versions: none)
ERROR: No matching distribution found for django
 

其实就是说连接超时,下载不了安装包,我这里也没有科学上网的工具,经过多方百度,找到了办法。通过几次pip的使用,对于默认的pip源的速度实在无法忍受,于是便搜集了一些国内的pip源,如下:

阿里云 http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) http://pypi.douban.com/simple/

清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/


但是经过网上给的方法进行安装,还是出现错误主要意思就是位于pypi.douban.com的存储库不是受信任的或安全的主机,正在被忽略。
要求使用“–trusted host pypi.douban.com”允许此警告。

解决办法:pip install django -i http://pypi.douban.com/simple --trusted-host pypi.douban.com(其中的django是你需要下载的,根据自己需求自行更改)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值