简体   繁体   English

在 Amazon Linux 2 上编译 python 3.10

[英]Compiling python 3.10 at Amazon Linux 2

I'm trying to compile and install Python 3.10 into a Amazon Linux 2 but I'm not being able to get it with https support.我正在尝试将 Python 3.10 编译并安装到 Amazon Linux 2 中,但我无法通过 https 支持获得它。 Here the commands that I'm using to compile it:这是我用来编译它的命令:

sudo yum -y update
sudo yum -y groupinstall "Development Tools"
sudo yum -y install openssl-devel bzip2-devel libffi-devel

wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
tar xzf Python-3.10.0.tgz
cd Python-3.10.0

sudo ./configure --enable-optimizations
sudo make altinstall

The binary works, but when I try to use it with for reach an https endpoint, I get this message:二进制文件有效,但是当我尝试使用它来访问 https 端点时,我收到以下消息:

Traceback (most recent call last):
  File "<stdin>", line 1113, in <module>
  File "<stdin>", line 1087, in main
  File "/usr/local/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.10/urllib/request.py", line 541, in _open
    return self._call_chain(self.handle_open, 'unknown',
  File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.10/urllib/request.py", line 1419, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>

I'm not sure what I'm missing :/我不确定我错过了什么:/

From Python3.10, OpenSSL 1.1.1 or newer is required.从 Python3.10 开始,需要 OpenSSL 1.1.1 或更新版本。

(Ref: PEP 644 , Python3.10 release ) (参考: PEP 644Python3.10 版本

I have tried changing some of your code like below and worked.我试过像下面这样更改你的一些代码并工作。

delete : openssl-devel删除openssl-devel

add : openssl11 openssl11-devel .添加openssl11 openssl11-devel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM