由于 openssl 问题,无法在 Amazon Linux 2 实例中安装最新的 python

问题描述 投票:0回答:1

我尝试使用源文件安装Python3.11.8。安装后,我无法导入 ssl

ModuleNotFound error due to OpenSSL version less than 1.1.1

所以,我安装了3.2.1版本。我在

LD_LIBRARY_PATH=/usr/local/openssl/lib64:$LD_LIBRARY_PATH
中导出了
bashrc

当我运行

openssl version
命令作为终端的一部分时,我得到
3.2.1
但是当我得到
ssl.OPENSSL_VERSION
作为 python3.11.8 env 的一部分时,我无法导入。

如果现有Python3.7版本,我可以

import ssl
但无法通过python3.7 env获取最新版本
ssl.OPENSSL_VERSION
。相反,我得到了 1.0.2 openssl 版本。因此,我无法导入
urllib3
和其他依赖项。

您能帮忙解决上述问题吗?

python-3.x amazon-web-services amazon-ec2 openssl
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.