If you are using Ubuntu 16.10 or newer, then you can easily install Python 3.6 typing the following commands in your terminal:
sudo apt-get update
sudo apt-get install python3.6
If you’re using another version of Ubuntu (e.g. the latest LTS release) or you want to use a more current Python, we recommend using the deadsnakes PPA to install Python 3.8:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.8
If you are using other Linux distribution, chances are you already have Python 3 pre-installed as well. If not, use your distribution’s package manager. For example on Fedora, you would use dnf
:
sudo dnf install python3
Note: you can also have Python if you install Anaconda (in case of interest see here).