NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with ‘LibreSSL 2.8.3’
macOS运行python脚本报错: OpenSSL 版本过低
解决方法:
1、检查OpenSSL 版本,使用以下命令:
openssl version
2、如果 OpenSSL 版本低于 1.1.1,可以使用以下方式升级:
brew update
brew upgrade openssl
安装完毕后,再次运行代码
3、对于 OpenSSL不方便操作的用户,降低urllib3版本即可:
pip install urllib3==1.26.16 -i https://pypi.tuna.tsinghua.edu.cn/simple
完成上述步骤后再次运行python脚本。