Compare the python and python3 symlinks in /etc/alternatives/ (e.g. with ls -lF /etc/alternatives/python*.
My guess is that python points to python3.8 while python3 points to python3.10. Or vice-versa.
Is there any particular reason why you want python to run 3.8 instead of 3.10? if not, run update-alternatives again and set it to either auto (preferred) or to 3.10 (you'll run into the same problem in future when 3.11 or 3.12 or whatever is the latest auto version).
Or just make sure that the alternatives symlinks for python and python3 point to the same version of python.
ubuntu - sudo update-alternatives --config . How to set the auto entry - Unix & Linux Stack Exchange
linux - How to update-alternatives to Python 3 without breaking apt? - Stack Overflow
How to set default Python version without --update-alternatives - Stack Overflow
How do I change python version defaults?
replace
[bash:~] $ sudo update-alternatives --install /usr/bin/python python \
/usr/bin/python2.7 2
[bash:~] $ sudo update-alternatives --install /usr/bin/python python \
/usr/bin/python3.5 3
with
[bash:~] $ sudo update-alternatives --install /usr/local/bin/python python \
/usr/bin/python2.7 2
[bash:~] $ sudo update-alternatives --install /usr/local/bin/python python \
/usr/bin/python3.5 3
e.g. installing into /usr/local/bin instead of /usr/bin.
and ensure the /usr/local/bin is before /usr/bin in PATH.
i.e.
[bash:~] $ echo $PATH
/usr/local/bin:/usr/bin:/bin
Ensure this always is the case by adding
export PATH=/usr/local/bin:$PATH
to the end of your ~/.bashrc file. Prefixing the PATH environment variable with custom bin folder such as /usr/local/bin or /opt/<some install>/bin is generally recommended to ensure that customizations are found before the default system ones.
Per Debian policy, python refers to Python 2 and python3 refers to Python 3. Don't try to change this system-wide or you are in for the sort of trouble you already discovered.
Virtual environments allow you to run an isolated Python installation with whatever version of Python and whatever libraries you need without messing with the system Python install.
With recent Python 3, venv is part of the standard library; with older versions, you might need to install python3-venv or a similar package.
$HOME~$ python --version
Python 2.7.11
$HOME~$ python3 -m venv myenv
... stuff happens ...
$HOME~$ . ./myenv/bin/activate
(myenv) $HOME~$ type python # "type" is preferred over which; see POSIX
python is /home/you/myenv/bin/python
(myenv) $HOME~$ python --version
Python 3.5.1
A common practice is to have a separate environment for each project you work on, anyway; but if you want this to look like it's effectively system-wide for your own login, you could add the activation stanza to your .profile or similar.