Recently I upgraded to Ubuntu 22.04 but it seems that my default python is still 3.8 instead of 3.10. It seems that both 3.9 and 3.10 have been installed already though. I am afraid that I installed python 3.8 manually in the wrong way a long time ago. I spent days already on this problem, but I cannot figure out where the 3.8 has been configured as default. *
Update: problem solved! I had installed python from source, into the /usr/bin/local directory. Hence the system ignored the newer python versions in user/bin. I had to remove the files from local and now everything works smoothly again
sudo update-alternatives --config python
update-alternatives: error: no alternatives for python
ls /usr/bin/python*
/usr/bin/python
/usr/bin/python3.10
/usr/bin/python3-config
/usr/bin/python2
/usr/bin/python3.10-config
/usr/bin/python3-futurize
/usr/bin/python2.7
/usr/bin/python3.9
/usr/bin/python3-pasteurize
/usr/bin/python3
/usr/bin/python3.9-config
which python3 (points to local, instead of the above directory with all python versions)
/usr/local/bin/python3
python3 --version
Python 3.8.0
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy