pip的时候报错:WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) aft

题目显示不全报错:WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002004EA35340>, 'Connection to pypi.tuna.tsinghua.edu.cn timed out. (connect timeout=15)')': /simple/pip/

个人理解:首先看报错提示感觉应该是之前换的清华源出问题了,但是已经忘记了怎么换源了

为了验证自己的想法,首先临时换源(阿里源)下载尝试一下:

pip install pygame -i http://mirrors.aliyun.com/pypi/simple/

然后出现了不一样的报错:

WARNING: The repository located at mirrors.aliyun.com 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 mirrors.aliyun.com'.

这个报错也很容易理解,不知道是什么原因,总是就是他不trust阿里源,好说,我们可以设定信任:

pip install pygame -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com 

然后果然成功下载了,到这时候也证明了我的猜想是正确的,只需要换一下默认镜像源应该就可以了。

 接下来就是更换默认镜像源的过程,我已经忘记了怎么更换了,所以参考一下别人的教程

参考教程:(20条消息) pip更改默认镜像源_pip 修改默认源_Stoneplay26的博客-CSDN博客

跟他的教程一样,换成了阿里源

OK,然后pip就正常了! 

  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值