Simply saying that packages are now python3 is not going to solve the problem,
If the app is written in Python 2, that’s not going to help.
IMO openSUSE needs to publish an official statement about not just dropping python 2, an SDB or official document should also be published providing official supported guidance for how Users can address problems like what this @OP is asking about… How to run python 2 apps.
It should be noted that there are no signs that the Python community is ending 32bit python anytime soon, v3.8.3 was released just a couple weeks ago as of this post.
So,
These are my recommended options off the top of my head…
- Download your needed package from the Official Python repositories (PyPi). Not all distros provide python from distro repositories like openSUSE, many install their python from PyPi as described.
First install pip from openSUSE
zypper in pip
The openSUSE version will almost always be out of date (The PyPi version updates often) so upgrade it, this is your first “install” from Python. Remember that everything you do is not visible to openSUSE so be aware that beyond simple changes like upgrading pip there is a chance your system could eventually acquire conflicts that won’t be resolvable easily.
To update pip (which is the python 2 version, pip3 is the python 3 version) from PyPi, this can be your very first (and safe) way to install a package from PyPi
pip install upgrade pip
After this, as I described you can install packages from PyPi including the needed package. In this case for MythTV, my guess is that package won’t be used by many things so it should be safe to mix that library in with the openSUSE python libraries, but in many cases you’d probably expose yourself to considerable risk of conflicts.
- Install and use Anaconda or Miniconda.
Although mainly used to install and run the scientific Anaconda apps, it can be used to install an entire Python environment without disturbing system Python libraries, this is accomplished by prepending the Anaconda path so that apps will find the python packages in Anaconda and won’t search for the openSUSE python packages. Should you choose to uninstall or disable Anaconda/miniconda, all you need to do is delete the Anaconda directory tree and optionally remove the path pointing to that directory tree.
The following are variations on (1)
1a. You can keep your PyPi packages separate from openSUSE libary files by using the “–user” option, but that generally means that only apps run in the User security context will know about your PyPi packages. Since the PyPi packages won’t be in your system path, applications running in some other security context won’t find your PyPi packages by default (more work to do)
1b.** The common time-honored way to run multiple versions of Python on a system** is to set up virtual environments using the virtualenv utility. This is based on a simple concept, you simply specify that a particular python you’ve made available is to be used by anything within a directory tree, and that directory tree is where your python app is installed. Today, I’ve found that this deprecated virtualenv tool still works fine, but I’m having problems setting up the python2 plugin to the modern python3 replacement pyenv. I haven’t looked at this again for a couple weeks, but if anyone knows how to do this successfully, pls provide info to the following thread
https://forums.opensuse.org/showthread.php/540144-Any-python-programmers-out-there-know-how-to-set-up-pyenv-virtualenv
The above are python-specific solutions, the following are generic solutions that can solve the problem of running python 2 in part or completely
1c. The application might be available as a Docker container.
1d. The application might be available through a Universal Installer like Flatpak and Snap.
1e. The application can be installed using virtualization like Virtualbox. This doesn’t solve the python 2 problem directly unless you install a distro that still supports python2, but it is another way to keep any special installs separate from your main system to avoid conflicts and possible failures.
HTH,
TSU