kms
kms

Reputation: 2024

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+

I am seeing this error when attempting to launch a jupyter notebook from the terminal.

Error loading server extension jupyterlab
    Traceback (most recent call last):
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/notebook/notebookapp.py", line 2047, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/jupyterlab/__init__.py", line 7, in <module>
        from .handlers.announcements import (  # noqa
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/jupyterlab/handlers/announcements.py", line 15, in <module>
        from jupyterlab_server.translation_utils import translator
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/jupyterlab_server/__init__.py", line 5, in <module>
        from .app import LabServerApp
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/jupyterlab_server/app.py", line 14, in <module>
        from .handlers import LabConfig, add_handlers
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/jupyterlab_server/handlers.py", line 18, in <module>
        from .listings_handler import ListingsHandler, fetch_listings
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/jupyterlab_server/listings_handler.py", line 8, in <module>
        import requests
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/requests/__init__.py", line 43, in <module>
        import urllib3
      File "/Users/kevalshah/myvenv/lib/python3.7/site-packages/urllib3/__init__.py", line 42, in <module>
        "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
    ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h  27 Mar 2018'. See: https://github.com/urllib3/urllib3/issues/2168

I have tried to upgrade and installed the following versions:

requests==2.31.0

urllib3==2.0.7

how do I resolve this issue? Do I need to upgrade my systems OpenSSL?

Upvotes: 0

Views: 5226

Answers (1)

dev_light
dev_light

Reputation: 4096

urllib3 v2.0 Migration Guide states that they have

Removed support for OpenSSL versions older than 1.1.1.

The best way to fix your issue is to upgrade to >= python 3.8 and then run python -m pip install urllib3. This is because the stable release of urllib3 Requires: Python >=3.8.

Otherwise, look at the Migration Guide included above for a possible fix to your issue.

Upvotes: 1

Related Questions