On Wed, Dec 23, 2020 at 2:21 AM Chris Green <c...@isbd.net> 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. >
It shouldn't be too hard to grab the source code for Python 2.7 and install it that way. The first step would be to ask apt to install all the build dependencies of Python 3; the same libraries will be important for building Python 2 (bar a couple that got added more recently, but that won't affect anything). Once you get it built, you can either just install it as is, or build yourself a package (with checkinstall or something) to be able to uninstall later. Personally, I'd just install it directly, but that's me. ChrisA -- https://mail.python.org/mailman/listinfo/python-list