Up until Ubuntu 18.04 LTS, both python2 and python3 were preinstalled on Ubuntu. Since Ubuntu 18.04 LTS, things have changed. Python2 is not preinstalled. Only python3 (v3.8.2 in 20.04) is preinstalled. At this moment if you run
python3 --version, you will see version 3.8.2 is installed. However if you have also installed python 2 (on your own, it is not preinstalled), then you can use
python2 --version or
python --version to check the version of python2.
To check info about python3, you will have to use
python3 --version or something which starts with
python3 explicitly. Where as
python2 will refer python2.
The reason they did this was because python2 itself has reached EOL (end of life).
Related news article.
Python 2 has now been moved to from main repository to universe repository.
The four main repositories are:
Main - Canonical-supported free and open-source software.
Universe - Community-maintained free and open-source software.
Restricted - Proprietary drivers for devices.
Multiverse - Software restricted by copyright or legal issues.
python command to point to python3, install
python-is-python3 package by running
sudo apt install python-is-python3 command in terminal.