TS:pip安装python库报ssl错误-2023.6.17(已解决)

2023.6.17-TS-pip安装python库报ssl错误(已解决)

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第1张图片

目录

文章目录

    • 2023.6.17-TS-pip安装python库报ssl错误(已解决)
    • 目录
    • 报错现象
    • 报错环境
    • 测试过程
      • 换其他源还是报错(失败)
      • 百度:替换为豆瓣源并加`--trusted-host参数`(成功)
    • 参考文章
    • 关于我
    • 最后

报错现象

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第2张图片

C:\Users\Win>pip install ipython
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)'))': /simple/ipython/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)'))': /simple/ipython/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)'))': /simple/ipython/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)'))': /simple/ipython/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)'))': /simple/ipython/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/ipython/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/ipython/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1124)'))) - skipping
ERROR: Could not find a version that satisfies the requirement ipython (from versions: none)
ERROR: No matching distribution found for ipython

报错环境

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第3张图片

win10

之前是有配置pip源为清华源:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

测试过程

换其他源还是报错(失败)

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第4张图片

百度:替换为豆瓣源并加--trusted-host参数(成功)

原因分析:

无法访问到https://pypi.tuna.tsinghua.edu.cn/simple/pip,SSL证书认证问题。

解决办法:

pip install ipython --trusted-host pypi.tuna.tsinghua.edu.cn 在语句后面将其设置为可信任即可,问题得到了解决。

  • 使用清华源安装:(会报错
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ipython --trusted-host pypi.tuna.tsinghua.edu.cn

image-20230617075925022

  • 使用豆瓣源安装:(成功)
pip install -i  http://pypi.douban.com/simple/ ipython --trusted-host pypi.douban.com

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第5张图片

可以看到,此时2023年6月17日清华源不能用了,这里就暂且使用豆瓣源即可。

  • 永久配置使用豆瓣源:
pip config set global.index-url http://pypi.douban.com/simple/

#后面使用如下命令安装python库就好
pip install ipython --trusted-host pypi.douban.com

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第6张图片

参考文章

https://blog.csdn.net/qq_32473523/article/details/122087467

https://blog.csdn.net/yuan2019035055/article/details/127530222

关于我

我的博客主旨:

  • 排版美观,语言精炼;
  • 文档即手册,步骤明细,拒绝埋坑,提供源码;
  • 本人实战文档都是亲测成功的,各位小伙伴在实际操作过程中如有什么疑问,可随时联系本人帮您解决问题,让我们一起进步!

微信二维码
x2675263825 (舍得), qq:2675263825。

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第7张图片

微信公众号
《云原生架构师实战》

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第8张图片

语雀

https://www.yuque.com/xyy-onlyone

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第9张图片

csdn
https://blog.csdn.net/weixin_39246554?spm=1010.2135.3001.5421

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第10张图片

知乎
https://www.zhihu.com/people/foryouone

TS:pip安装python库报ssl错误-2023.6.17(已解决)_第11张图片

最后

好了,关于本次就到这里了,感谢大家阅读,最后祝大家生活快乐,每天都过的有意义哦,我们下期见!

你可能感兴趣的:(python,pip,ssl)