pip出错,提示WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))

本文详细解析了pip在安装或升级过程中遇到的SSL证书验证失败问题,并提供了通过ntpdate命令与互联网时间服务器同步本机时间的解决方案,确保pip操作顺利进行。

命令pip install *或命令python3 -m pip install --upgrade pip提示信息:
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1056)’))’: /simple/pip/

命令pip show pip提示信息:
/system/python/lib/python3.7/site-packages/pip/_vendor/urllib3/connection.py:340: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors SystemTimeWarning Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1056)’))) - skipping

问题分析:
可能是由于主板上用于保存内部时钟的纽扣电池没电或松动导致的本机与服务器时间不同步的问题。
解决方案(Linux):1
利用ntpdate与互联网上的ntp服务器同步硬件时间
ntpdate -u 210.72.145.44

ntpdate ntp.api.bz
如果出现如下提示:

1 Jan 08:18:27 ntpdate[1830]: no server suitable for synchronization found

则表示同步失败
出现如下提示:

12 Jun 00:40:39 ntpdate[1831]: step time server 114.118.7.161 offset 1591892511.869846 sec

则同步成功
再使用date命令查看时间时,应该恢复正常,且pip也可以正常更新、安装。

*思路来源:StackOverflow2

References


  1. ntpdate同步更新时间_luchuangao ↩︎

  2. How to install pip for installing external packages in NAO robot_Shubham Verma ↩︎

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学渣戊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值