gpt4 book ai didi

Python 3.6 请求 SSLerror "unexpected eof while reading'

转载 作者:行者123 更新时间:2023-12-04 22:37:56 25 4
gpt4 key购买 nike

以下代码在 Python 2.7 下运行良好:

import requests
url = "https://ec.europa.eu/clima/ets/"
r = requests.get(url)
r.status_code

但是在 Python 3.6 或 3.7 下,代码中断并显示错误消息:

SSLError: ("read error: Error([('SSL routines', 'ssl3_read_n', 'unexpected eof while reading')],)",)



非常感谢每一个如何在 Python 3 下运行它的建议。

附言在所有 python 版本下请求版本为 2.22

更新

似乎该错误是由 openssl 版本 1.1.1e 引起的。升级到 1.1.1f 为我解决了这个问题。

最佳答案

这可能与 openssl 1.1.1e 错误有关

您是您拥有的服务器检查版本

yum info ea-openssl11

如果你有 1.1.1e,那么你可以降级到 1.1.1d
yum downgrade ea-openssl11

如果有的话,重新启动 php-fpm

关于Python 3.6 请求 SSLerror "unexpected eof while reading',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60871482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com