How to install Python 3.9 interpreter on Ubuntu 20.04

In this tutorial guide, we are going to learn how to install Python 3.9 on Ubuntu 20.04.

Python is an interpreted high-level general-purpose programming language. Its designed philosophy emphasizes code readability with its use of significant indentation.

We can begin by installing a python 3 interpreter on our system. This is a program that reads Python programs and carries out their instructions, you need it before you can begin python programming.

Linux distribution may include an outdated version of Python 2. We need to install Python 3 which is an updated version.

There are two ways we can install the official Python distribution in Linux:

  • Using operating system package manager
  • Building Python from source code

Let’s first check the version of python in our systems.

python --version
Command 'python' not found, did you mean:

  command 'python3' from deb python3
  command 'python' from deb python-is-python3

Check python 2 version

python2 --version
Command 'python2' not found, but can be installed with:

sudo apt install python2

check python3 version

python3 --version
Python 3.8.10

From the above, you can see that Python2 isn’t available from the latest version of ubuntu 20.04. Python3 comes as a default.

Let’s begin the installation process: Type the following code into your terminal.

sudo apt-get update

This code updates the Ubuntu repository:

Install Python 3.9

Next, we can install Python 3.9 plus pip package which is the package installer for Python.

sudo apt-get install python3.9 python3-pip

And that’s all with python installation.

Now let’s check once again

python3.9 --version
Python 3.9.5

That is all. Happy coding.

About Kipkoech Sang

I am a technology enthusiast who loves to share gained knowledge through offering daily tips as a way of empowering others. I am fan of Linux and all other things open source.
View all posts by Kipkoech Sang →

Leave a Reply

Your email address will not be published.