问题描述
使用timm时
from timm.models.vision_transformer import Block
遇到报错:
ImportError
urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2u 20 Dec 2019'.
解决方案
参考ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with LibreSSL 2.8.3的解决方案:使用兼容的旧版urllib3,其没有严格的OpenSSL 版本要求。可以使用如下命令强制安装版本:
pip install urllib3==1.26.6
参考
1、https://stackoverflow.com/questions/76187256/importerror-urllib3-v2-0-only-supports-openssl-1-1-1-currently-the-ssl-modu