EDIT: Updates below, the scenery seems to have changed significantly.
I have Ubuntu 20.04, and have installed Python 3.10 manually. There's python 2 in the system already, and that's what I get if I simply execute python
at a command line, rather than python3
. However, I only seem to have a version of pip that is specific to python3.
I have a program that I want to run (chirp) which is written in python2. It complains of the lack of a serial library:
$ ./chirpw
Traceback (most recent call last):
File "./chirpw", line 24, in <module>
from chirp.drivers import *
File "/home/simon/chirp-daily-20220103/chirp/drivers/idrp.py", line 16, in <module>
import serial
ImportError: No module named serial
However, if I attempt to get this module with pip, I end up with pip3 running and get the python3 version of this module.
How should I go about adding a library to python2 specifically (and ensure that the library that's fetched is the python2 library)?
I suppose the "best" way might be to create a virtual environment specifically for this particular program, but I don't know how to do that in the case of a pre-existing program either.
Any pointers gratefully accepted.
EDIT. I found this page: setting up pipenv and virtualenvironments and I seem to have moved forward. I now seem to have an actual virtual environment built around /usr/bin/python (which is python2.7), and using it, pip -install serial worked. However, after doing this, it's now complaining that it can't find the module gtk, and the attempt to load that module fails saying there's no such module:
(venv) :~/chirp-daily-20220103$ python -m pip install gtk
DEPRECATION:[...]
ERROR: Could not find a version that satisfies the requirement gtk (from versions: none)
ERROR: No matching distribution found for gtk
Next I tried the flatpak version of this, but flatpak isn't working for me at all. I'll open a different question on that, since we're now well off my original question's topic.
Thanks to all who tried to help :)