Home > Blockchain >  Compiling python 3.10 at Amazon Linux 2
Compiling python 3.10 at Amazon Linux 2

Time:10-25

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. 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:

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 :/

CodePudding user response:

From Python3.10, OpenSSL 1.1.1 or newer is required.

(Ref: PEP 644, Python3.10 release)

I have tried changing some of your code like below and worked.

delete: openssl-devel

add: openssl11 openssl11-devel.

  • Related