Skip to content

Python 3.12 doesn't build SSL module although available #149453

@bernborgess

Description

@bernborgess

When installing Python3.12 from the .tgz file, I use these commands:

wget https://www.python.org/ftp/python/3.12.13/Python-3.12.13.tgz
tar -xvzf Python-3.12.13.tgz
cd Python-3.12.13/
./configure --prefix=$HOME/prog/python312 --enable-shared \
  --enable-optimizations --enable-ipv6 \
  LDFLAGS=-Wl,-rpath=$HOME/prog/python312/lib,--disable-new-dtags \
  --with-openssl=/usr/bin/openssl
make
  • Output
[...]
The following modules are *disabled* in configure script:
_sqlite3                                                       

The necessary bits to build these optional modules were not found:
_bz2                  _dbm                  _gdbm              
_hashlib              _lzma                 _ssl               
_tkinter              _uuid                 readline           
To find the necessary bits, look in configure.ac and config.log.

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

Checked 111 modules (31 built-in, 69 shared, 1 n/a on linux-x86_64, 1 disabled, 9 missing, 0 failed on import)
make[1]: Leaving directory '/home/bernborgess/Downloads/Python-3.12.13'

And then I can't use pip properly:

$ pip install -r requirements.txt 
WARNING: Disabling truststore since ssl support is missing
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/filelock/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/filelock/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/filelock/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/filelock/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/filelock/
Could not fetch URL https://pypi.org/simple/filelock/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/filelock/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement filelock==3.25.2 (from versions: none)
WARNING: Disabling truststore since ssl support is missing
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: No matching distribution found for filelock==3.25.2

However, it is installed:

$ uname -a
Linux gogh 6.8.0-111-generic #111~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 14 17:13:45 UTC  x86_64 x86_64 x86_64 GNU/Linux
$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions