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 python
and python2
will refer python2.
EDIT 1
The reason they did this was because python2 itself has reached EOL (end of life).
Related news article.
EDIT 2
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.
EDIT 3
To make python
command to point to python3, install python-is-python3
package by running sudo apt install python-is-python3
command in terminal.
python3 --version
>> Python 3.8.2. If you like to runpython3
usingpython
then installpython-is-python3
package. – Ravexina♦ Jul 7 '20 at 8:03python
generally refers to Python 2 unless configured/specified. On releases > 18.04, Python 2 isn't installed by default since it's dead. 20.04 gives you an option to invoke Python 3 usingpython
by merely installing a package. – Kulfy Jul 7 '20 at 8:06