已解决WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python

已解决(pip升级报错)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pip in e:\anaconda\install_root\lib\site-packages (21.0.1)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/pip/

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(“Can’t connect to HTTPS URL because the SSL module is not available.”)) – skipping







报错代码



粉丝群里面的一个小伙伴想升级pip,但是发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小伙伴),报错代码如下:

在这里插入图片描述


报错信息截图如下


在这里插入图片描述




报错翻译



报错信息翻译


警告:pip配置了需要TLS/SSL的位置,但是Python中的SSL模块不可用。
查找索引:https://pypi.tuna.tsinghua.edu.cn/simple
已满足要求:e:\anaconda\install_root\lib\site包中的pip(21.0.1)
警告:连接被“SSLError”(“无法连接到HTTPS URL,因为SSL模块不可用。”)断开后,正在重试(重试(总计=4,连接=无,读取=无,重定向=无,状态=无):/simple/pip/

无法获取URLhttps://pypi.tuna.tsinghua.edu.cn/simple/pip/:确认ssl证书时出现问题:HTTPSConnectionPool(host=‘ypi.tuna.tsinghua.edu.cn’,port=443):url:/simple/pip/超过了最大重试次数(由SSLError(“无法连接到HTTPS url,因为ssl模块不可用。”)-跳过





报错原因



报错原因:Python中的SSL模块不可用,导致ssl证书认证失败。





解决方法



(1)加上--trusted-host pypi.tuna.tsinghua.edu.cn后缀表示信任镜像文件:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U --trusted-host pypi.tuna.tsinghua.edu.cn

在这里插入图片描述


(2)上面语句如果不行的话执行下面这条:

pip install -i http://pypi.douban.com/simple/  pip -U --trusted-host pypi.douban.com

帮忙解决

本文已收录于:《告别Bug》专栏

本专栏用于记录学习和工作中遇到的各种疑难Bug问题,以及粉丝群里小伙伴提出的各种问题,文章形式:报错代码 + 报错翻译 + 报错原因 + 解决方法,包括程序安装、运行程序过程中等等问题,订阅专栏+关注博主后如遇到其他问题可私聊帮忙解决!!!

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
心中带点小风骚的头像心中带点小风骚普通用户
上一篇 2023年3月5日 下午2:19
下一篇 2023年3月5日 下午2:20

相关推荐