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

Michael Shoemaker
1 min readJul 24, 2021


This solution was created by GitHub user JustAnotherArchivest in the issue on GitHub.

Lately I’ve been using pyenv which is AWESOME! However, when I went to install an older version of Python (2.7.9) I received the error below. Which is not awesome.

Luckily it didn’t take too much Googling for me to find the answer in the issue I mentioned at the above.

Just execute the commands below and the issue should be resolved.

> mkdir ~/libssl1.0-dev
> cd ~/libssl1.0-dev
> apt-get download libssl1.0-dev
> ar x libssl1.0-dev_1.0.2l-2+deb9u3_amd64.deb data.tar.xz
> tar -xf data.tar.xz --strip-components=2
> rm data.tar.xz
> ln -s /usr/lib/x86_64-linux-gnu/ ~/libssl1.0-dev/lib/x86_64-linux-gnu> ln -s /usr/lib/x86_64-linux-gnu/ ~/libssl1.0-dev/lib/x86_64-linux-gnu

This is just a re-posting of the solution that was created by JustAnotherArchivest, but I hope by making an article on Medium the magic that is Google will help it bubble up to the top in search results for this error and hopefully save some people some time.



Michael Shoemaker

Technologist and tinkerer.