Python Installation on Ubuntu

To install python in Ubuntu you must open the terminal, you can find it through the computer’s search engine.

While in the terminal, type the following commands:

Step 1 Link to heading

Update the package list.

sudo apt update

Step 2 Link to heading

Install a package required to add software repositories to your system.

sudo apt install software-properties-common

Step 3 Link to heading

Add the Dead Snakes PPA repository to your system. This repository contains newer versions of Python than those found in the official Ubuntu repositories.

sudo add-apt-repository ppa:deadsnakes/ppa

Step 4 Link to heading

Update the package list again, this time including packages from the Dead Snakes PPA repository.

sudo apt update

Step 5 Link to heading

Install Python3 in its most recent version.

sudo apt install python3.X

You can also replace the X with the specific version you want to install.

Step 6 Link to heading

Check the installation and the installed python version.

python3 --version

Step 7 Link to heading

Run python in terminal


Now you can program with python in your console and to exit press ctrl+D.

We recommend that you research code editors so that you can choose the one you prefer.

<< Installing Python on Windows >>