Error Knowledge Base pip SSL_MODULE_NOT_AVAILABLE

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Your Python was built or installed without SSL support, so pip cannot make HTTPS requests to package indexes like PyPI.

Where the Request Failed

Your Python was built or installed without SSL support, so pip cannot make HTTPS requests to package indexes like PyPI.

Use a Python build with SSL support

Reinstall Python from a trusted distribution that includes SSL support (system Python, python.org installers, or a well-supported env manager).

If compiling Python, install OpenSSL dev dependencies first, then rebuild Python so the ssl module is built.

After fixing Python, upgrade pip:python -m pip install --upgrade pip

Retry the original pip install command.

Prove the Failing Environment Can Reach It

Run python -c 'import ssl; print(ssl.OPENSSL_VERSION)' and confirm it succeeds, and run python -m pip install <package> and confirm pip can reach HTTPS indexes.

Check the active Python runtime

Test SSL import:python -c 'import ssl; print(ssl.OPENSSL_VERSION)'

Confirm which Python is active:python -c 'import sys; print(sys.executable)'

If you built Python yourself, inspect how OpenSSL was linked/packaged.

Why This Environment Blocks the Change

Usually this comes down to python was compiled without OpenSSL development libraries available, so _ssl/ssl wasn't built, a custom Python distribution is missing SSL runtime dependencies, or the environment is misconfigured (wrong dynamic libraries, broken OpenSSL install).

Examples

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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: ... (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

Why pip needs the Python ssl module

This is the part worth understanding if the quick fix did not hold. It explains what pip is trying to do at the moment the error appears.

pip downloads packages over HTTPS from indexes (PyPI, mirrors, private registries). HTTPS support in Python relies on the built-in ssl module, which depends on OpenSSL (or another TLS backend) being present at build/runtime.

If import ssl fails, pip cannot securely connect to package sources.

Prevent Repeat Connectivity Failures

To prevent this, avoid custom-building Python for production unless you manage its SSL dependencies carefully, standardize Python distributions across dev/CI, and keep OpenSSL and Python updated to receive security fixes and modern TLS defaults.

Docs and source code

github.com/pypa/pip/blob/25.3/src/pip/_internal/models/search_scope.py

pip warns about missing TLS support when it detects ssl/TLS is unavailable, but you have HTTPS index URLs configured. - GitHub

        # If we don't have TLS enabled, then WARN if anyplace we're looking
        # relies on TLS.
        if not has_tls():
            for link in itertools.chain(index_urls, built_find_links):
                parsed = urllib.parse.urlparse(link)
                if parsed.scheme == "https":
                    logger.warning(
                        "pip is configured with locations that require "
                        "TLS/SSL, however the ssl module in Python is not "
                        "available."
                    )
                    break

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list