I have installed python 3.10 on my Ubuntu. Now I have there two versions: 3.8 and 3.10. I would like to set Python 3.10 as a default. I followed the advice here: Change the Python3 default version in Ubuntu
ls /usr/bin/python*
/usr/bin/python3 /usr/bin/python3.8-config /usr/bin/python3-pasteurize
/usr/bin/python3.10 /usr/bin/python3-config
/usr/bin/python3.8 /usr/bin/python3-futurize
I tried to set get python3.10 priority 1 and python3.8 priority 2:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
I can check it using:
sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).
Selection Path Priority Status
0 /usr/bin/python3.8 2 auto mode
- 1 /usr/bin/python3.10 1 manual mode
2 /usr/bin/python3.8 2 manual mode
But when I check current python version I still see the old one:
python3 --version
Python 3.8.10
How can I fix my problem please?
python3 --version
? – vojtam Jan 26 '22 at 09:48/usr/bin/python python
instead of/usr/bin/python3 python3
. – schrodingerscatcuriosity Jan 26 '22 at 09:49whereis python3
Many suggest Many suggest this: https://github.com/pyenv/pyenv pyenv lets you easily switch between multiple versions of Python. But I have always use default and if necessary update the few programs of mine that use python. – oldfred Mar 16 '23 at 19:26