Skip to content
Advertisement

Python 2.7.12 on Ubuntu 20.04 in PyEnv

I have some legacy websites that run on Python 2.7.12 and have just updated my dev machine to Ubuntu 20.04.

I am trying to get PyEnv to install Python 2.7.12, but it seems that this depends on libssl1.0-dev which has been dropped in Ubuntu 20.04.

I get error:

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

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (Ubuntu 20.04 using python-build 20180424)

Following advice here I run:

sudo apt-get remove libssl-dev
sudo apt-get update
sudo apt-get install libssl1.0-dev

I get error:

E: Package 'libssl1.0-dev' has no installation candidate

Is there any way of doing this? If so then how please?

Thank you.

Advertisement

Answer

As Klaus mentioned you could use docker image for python 2.7, but ssl library is very crucial, so it’s weird that it has no installation candidate. The package libssl-dev for focal is listed here

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement