libssl not found by Python on Ubuntu 22.04

3.4k views Asked by At

As the title says, I've just upgraded to Ubuntu 22.04 LTS and my previously working setup now says ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory when starting Jupyter, and equivalently throws Could not fetch URL https://pypi.org/simple/jupyter/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/jupyter/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping whenever trying to use pip.

Libssl is actually available at /usr/lib/x86_64-linux-gnu/libssl.so.1.1. I could change LD_LIBRARY_PATH but this seems to be a workaround.

1

There are 1 answers

2
Yuri Thomas Pinheiro Nunes On

I resolved this problem by reinstalling the environment.

I use pipenv and pyenv. I removed the pipenv environment and the Python version using pyenv. Then reinstalled both.