While installing Python using pyenv, I am getting the following error:

ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

I am using Ubuntu 18.04 Bionic Beaver How do I solve this issue?


3 Answers 3


If the python version you are trying to install is equal or lower than 2.7.12, it does not support OpenSSL1.1.0, so you would need to replace libssl-dev with libssl1.0-dev.

Ubuntu 18.04 is the first official release to switch to OpenSSL1.1.0 which is why you might not have been impacted with this in the past.

Reference: https://github.com/pyenv/pyenv/issues/945



check you version: openssl version
pyenv install 3.9 #ok
pyenv install 3.10 #error
Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. For the most part Python also works with LibreSSL >= 2.7.1
with some missing features and broken tests.


According to the documentation, a simple:

pip install pyopenssl

should do the job. If pip is not installed, run

sudo apt install python-pip

and then run the command again.

  • I am still getting the same error. Can you suggest some other solution?
    – codehia
    May 10, 2018 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .