I just updated 20.04 to 22.04, and I got some trouble with python versions. On 20.04, I had just python 3.8, and now on 22.04 it seems I have 3.10 only.
(base) giammi56@giammi56-T440p:~$ ls /usr/bin/python*
/usr/bin/python
/usr/bin/python3.10-config
/usr/bin/python3-pasteurize
/usr/bin/python3
/usr/bin/python3-config
/usr/bin/python-argcomplete-check-easy-install-script3
/usr/bin/python3.10
/usr/bin/python3-futurize
/usr/bin/python-argcomplete-tcsh3
(base) giammi56@giammi56-T440p:~$ apt list | grep python3.8
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libpython3.8-minimal/now 3.8.10-0ubuntu1~20.04.6 amd64 [residual-config]
python3.8-minimal/now 3.8.10-0ubuntu1~20.04.6 amd64 [residual-config]
ON 20.04, I aliased pip with pip3, but could this be problematic now?
(base) giammi56@giammi56-T440p:~$ pip --version
pip 23.0.1 from /home/giammi56/.local/lib/python3.10/site-packages/pip (python 3.10)
(base) giammi56@giammi56-T440p:~$ pip3 --version
pip 23.0.1 from /home/giammi56/.local/lib/python3.10/site-packages/pip (python 3.10)
(base) giammi56@giammi56-T440p:~$ pip3.8 --versionpip 23.0.1 from /home/giammi56/.local/lib/python3.10/site-packages/pip (python 3.10)
Clearly, some applications installed in pip do not work. Undervolt
is the best example. The command is recognized, but not when sudo
. Here the essential:
(base) giammi56@giammi56-T440p:~$ sudo undervolt --read
sudo: undervolt: command not found
(base) giammi56@giammi56-T440p:~$ undervolt
usage: undervolt [-h] [--version] [-v] [-f] [-r] [-t TEMP] [--temp-bat TEMP_BAT] [--throttlestop THROTTLESTOP]
[...]
(base) giammi56@giammi56-T440p:~$ locate undervolt
/etc/systemd/system/undervolt.service
/etc/systemd/system/hibernate.target.wants/undervolt.service
/etc/systemd/system/hybrid-sleep.target.wants/undervolt.service
/etc/systemd/system/multi-user.target.wants/undervolt.service
/etc/systemd/system/suspend.target.wants/undervolt.service
/home/giammi56/.cache/pip/wheels/ad/e5/e3/b8b0b993874dde746b5d3ffc16b122f15045fb98abd12d41ab/undervolt-0.3.0-py3-none-any.whl
/home/giammi56/.local/bin/undervolt
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info
/home/giammi56/.local/lib/python3.8/site-packages/undervolt.py
/home/giammi56/.local/lib/python3.8/site-packages/__pycache__/undervolt.cpython-38.pyc
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/INSTALLER
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/METADATA
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/RECORD
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/REQUESTED
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/WHEEL
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/entry_points.txt
/home/giammi56/.local/lib/python3.8/site-packages/undervolt-0.3.0.dist-info/top_level.txt
/usr/local/bin/undervolt
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info
/usr/local/lib/python3.8/dist-packages/undervolt.py
/usr/local/lib/python3.8/dist-packages/__pycache__/undervolt.cpython-38.pyc
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info/INSTALLER
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info/METADATA
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info/RECORD
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info/WHEEL
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info/entry_points.txt
/usr/local/lib/python3.8/dist-packages/undervolt-0.3.0.dist-info/top_level.txt
I don't know how to proceed. A suggested thread suggests a generic reinstallation. Should I upgrade all the python3.8 programs to 3.10? Is the alias still good? IN case I have multiple versions of python, I do I invoke a program from terminal/.desktop file/. service with the correct version? Any help would be deeply appreciated.
How can I test/find out which programs should be upgraded? Should I simply wait the moment something fails? Should I instead upgrade by default? Is there in case a standard procedure?
– giammi56 Feb 28 '23 at 07:53python3.8 -m module/package
correctly says I don't have python3.8 (command not found). I do still have the libraries/home/giammi56/.local/lib/python3.8/site-packages/
(2.7 GB) and/usr/local/lib/python3.8/dist-packages/
(60 MB). At a visual inspection, many applications were not ported from 3.8 to 3.10. Should I perhaps reinstall 3.8, manage it viaupdate-alternatives
and port manually? Is there any guide on how to do that in a more programmatic/standard way? – giammi56 Feb 28 '23 at 12:36~/.local/lib/python3.8/
directory might be no longer usable ... There are ways that would e.g. parse that directory for module names and then reinstall them into python3.10 automatically but they are not safe ... I recommend manually reinstalling those modules you need withpip install -U ...
... The same goes for the/usr/local/lib/python3.8/
directory as well. – Raffa Feb 28 '23 at 13:33pip freeze > ~/my_file
... This kind of backup list would be possible to safely automate its installation in a new Python version. – Raffa Feb 28 '23 at 13:53~/.local/lib/python3.8/site-packages/*
to your virtual environment directory under e.g.env/lib/python3.8/site-packages/
and that might need some tweaks but should work ... You then might be able to activate that virtual env. and backup modules/packages from within the virtual env. with e.gpip freeze > ~/my_file
then auto install and update those in the new python3.10 with e.g.pip install -Ur ~/my_file
... It's safe to try anyway and will most likely work ... Good thinking :) – Raffa Feb 28 '23 at 14:58python3.8 -m pip freeze > ~/my_file
and afterwardspip install -Ur ~/my_file
would automatically port and update old modules/packages to python3.10 – Raffa Feb 28 '23 at 15:28