每次我尝试导入请求和其他库时都会出现此错误:
C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe C:\Users\Administrator\PycharmProjects\pythonProject11\main.py
Traceback (most recent call last):
File "C:\Users\Administrator\PycharmProjects\pythonProject11\main.py", line 1, in <module>
import requests
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\__init__.py", line 43, in <module>
import urllib3
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\__init__.py", line 42, in <module>
"urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar 2018'. See: https://github.com/urllib3/urllib3/issues/2168
我是编码新手,去了 stackoverflow,但大多数解决方案都不起作用!
该错误表明最新版本的urllib3仅支持OpenSSL版本,1.1.1+。试试这个
pip uninstall urllib3
pip install urllib3==1.26.16