Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 252
Doug Avatar asked Apr 19 '26 17:04

Doug


1 Answers

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

like image 169
RafalS Avatar answered Apr 21 '26 08:04

RafalS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!