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.

Affected versions: All pip versions (depends on Python/SSL build).

What This Error Means

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

How to Fix It

  1. Reinstall Python from a trusted distribution that includes SSL support (system Python, python.org installers, or a well-supported env manager).
  2. If compiling Python, install OpenSSL dev dependencies first, then rebuild Python so the ssl module is built.
  3. After fixing Python, upgrade pip: python -m pip install --upgrade pip.
  4. Retry the original pip install command.

Why It Happens

  • Python was compiled without OpenSSL development libraries available, so _ssl/ssl wasn't built.
  • A custom Python distribution is missing SSL runtime dependencies.
  • The environment is misconfigured (wrong dynamic libraries, broken OpenSSL install).

How to Verify

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

Manual SSL availability checks

  1. Test SSL import: python -c 'import ssl; print(ssl.OPENSSL_VERSION)'.
  2. Confirm which Python is active: python -c 'import sys; print(sys.executable)'.
  3. If you built Python yourself, inspect how OpenSSL was linked/packaged.

Common CLI Output

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

  1. pip downloads packages over HTTPS from indexes (PyPI, mirrors, private registries).
  2. HTTPS support in Python relies on the built-in ssl module, which depends on OpenSSL (or another TLS backend) being present at build/runtime.
  3. If import ssl fails, pip cannot securely connect to package sources.

Prevention Tips

  • Avoid custom-building Python for production unless you manage its SSL dependencies carefully.
  • Standardize Python distributions across dev/CI.
  • Keep OpenSSL and Python updated to receive security fixes and modern TLS defaults.

Where This Can Be Triggered

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