Installing Python (2.7) 'by hand' on Ubuntu - possible?

Michael Torrie torriem at gmail.com
Tue Dec 22 11:19:55 EST 2020


On 12/22/20 8:10 AM, Chris Green wrote:
> I have (as discussed here) a printer utility that uses Python 2 and I
> can't update it to Python 3 because it has a .so library file which is
> compiled for Python 2.  I think I have exhausted all the possibilities
> for converting it to Python 3 so now I'm looking at how to keep it
> working on my [x]ubuntu Linux systems as Python 2.7 becomes unsupported.
> 
> How realistic/possible would it be to run the utility in a separate
> environment with its own copies of Python2 and any modules and
> libraries needed?  I would install these 'by hand', i.e. not using
> 'apt' so they would stay as installed even as my system gets upgraded. 
> 
> There would obviously be *some* dependencies on the system libraries
> but I think they'd be pretty low level and thus their interfaces would
> be very unlikely to change for a long time so I should be able to run
> my old Python2.7 and the Python modules needed for the utility for
> quite a few years anyway (the printer it supports will wear out
> eventually!).

Probably your best bet is to build a container image (perhaps a snap)
around with a distro that has Python 2.7 in it to house your app. That
way you've got everything you need including the required system
libraries.  Right now you could build a image of it based on Ubuntu
20.04 which has python 2.7 as an optional installable package.

Sure you could build Python 2.7 for as long as the compatible compilers
and other dependent libraries are available.  I expect RHEL to keep
building python 2.7 for another 10 years.  Ubuntu 20.04 will continue to
ship python 2.7 as an optional package for another 5 years at least.

There are ways even besides containers that work. With some scripts to
set up custom library paths and trees of custom libraries, you can run
old binary software on newer distros even. With some help from the
interwebs, I am able to run WordPerfect 8 for Linux on my Fedora 32 box.
 That was released back in the kernel 2.0 days, before the transition to
glibc.


More information about the Python-list mailing list