Python – ssl.SSLError: [SSL: LIBRARY_HAS_NO_CIPHERS] library has no ciphers (_ssl.c:3135)

python3 -m pip install pdfplumber pymupdf openpyxl pillow requests --trusted-host pypi.org --trusted-host files.pythonhosted.org
Defaulting to user installation because normal site-packages is not writeable
WARNING: There was an error checking the latest version of pip.
ERROR: Exception:
Traceback (most recent call last):
  File "Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\cli\base_command.py", line 107, in _run_wrapper
    status = _inner_run()
  File "Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\cli\base_command.py", line 98, in _inner_run
    return self.run(options, args)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\cli\req_command.py", line 96, in wrapper
    return func(self, options, args)
  File "\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\commands\install.py", line 340, in run
    session = self.get_default_session(options)
  File "C:\Users\pwell\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\cli\index_command.py", line 82, in get_default_session
    self._session = self.enter_context(self._build_session(options))
                                       ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\cli\index_command.py", line 101, in _build_session
    ssl_context = _create_truststore_ssl_context()
  File "\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pip\_internal\cli\index_command.py", line 51, in _create_truststore_ssl_context
    ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.3568.0_x64__qbz5n2kfra8p0\Lib\ssl.py", line 438, in __new__
    self = _SSLContext.__new__(cls, protocol)
ssl.SSLError: [SSL: LIBRARY_HAS_NO_CIPHERS] library has no ciphers (_ssl.c:3135)

What’s wrong

The failure is not pip or your packages. ssl is broken before any download: creating a TLS context raises SSL: LIBRARY_HAS_NO_CIPHERS.

We confirmed:

  • Without any change, ssl.create_default_context() fails the same way pip does.
  • With OPENSSL_CONF=NULssl.create_default_context() succeeds and pip install completes (your packages installed successfully in this environment).

So OpenSSL is reading a system config that leaves you with no usable TLS ciphers.

Likely root cause (system openssl.cnf)

Under C:\Program Files\Common Files\SSL\openssl.cnf, the OpenSSL 3 provider section turns on legacy but does not activate the default provider:

[default_sect]

# activate = 1

[legacy_sect]

activate = 1

OpenSSL’s own comments in that file say that if you explicitly activate other providers, you usually must also activate the default provider, or things break. That matches “library has no ciphers” for normal TLS.

What you can do

1. Quick workaround (no admin)

In PowerShell for that session:

$env:OPENSSL_CONF = ‘NUL’

python3 -m pip install …

Or one line:

$env:OPENSSL_CONF=’NUL’; python3 -m pip install pdfplumber pymupdf openpyxl pillow requests

To make it permanent for your user: System Properties ? Environment Variables ? User ? add OPENSSL_CONF = NUL. (Some other OpenSSL-based tools will also skip the broken global config.)

2. Proper fix (needs Administrator)

Edit C:\Program Files\Common Files\SSL\openssl.cnf, in [default_sect], uncomment so the default provider is activated:

[default_sect]

activate = 1

Save (elevated/editor as admin). After that you can drop OPENSSL_CONF=NUL.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...