ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar
时间: 2023-11-08 10:04:17 浏览: 7406
这个错误是因为你的 Python 环境使用的是 OpenSSL 1.1.0h,而 urllib3 v2.0 需要使用 OpenSSL 1.1.1。有两种解决方法:
1. 升级 OpenSSL 到 1.1.1 或更高版本。
2. 降级 urllib3 到 v1.x 版本,可以通过命令 `pip install urllib3==1.*` 来实现。
相关问题
urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar 2018'
引用\[1\]: 这个错误是由于您的系统中的ssl模块版本与urllib3 v2.0所需的OpenSSL版本不兼容导致的。urllib3 v2.0只支持OpenSSL 1.1.1+版本,而您的系统中的ssl模块是使用的OpenSSL 1.1.0h版本。为了解决这个问题,您可以尝试升级您的OpenSSL版本到1.1.1+,或者降级urllib3的版本以适应您当前的ssl模块版本。
#### 引用[.reference_title]
- *1* [Python报错ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the ‘ssl‘ module is ...](https://blog.csdn.net/qq_38122800/article/details/130603051)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with OpenSSL 1.1.0h 27 Mar 2018.
这个错误是由于urllib3版本需要使用OpenSSL 1.1.1或以上版本而当前的ssl模块编译是使用的OpenSSL 1.1.0h版本引起的。 问题的解决方法是更新ssl模块的编译版本,使其兼容urllib3 v2.0所需的OpenSSL 1.1.1版本。具体的解决方法如下:
1. 首先,你需要检查你的系统中是否已经安装了OpenSSL 1.1.1或更高版本。如果已经安装,则需要确认Python使用的是正确的OpenSSL版本。你可以使用命令`openssl version`检查当前系统中使用的OpenSSL版本。
2. 如果你没有安装OpenSSL 1.1.1或更高版本,你需要按照官方文档或指南下载和安装最新版本的OpenSSL。
3. 安装完成后,你需要重新编译ssl模块以使用新版本的OpenSSL。具体的操作方式可能因系统而异,你可以查阅Python官方文档或相应的资源来了解如何编译并更新ssl模块。
4. 完成ssl模块的更新后,你可以再次运行你的代码,应该就不会再出现这个错误了。
注意:在进行任何更新或更改之前,请务必备份你的代码和相关文件,以防止意外损失。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)