How to Install Python 3.9 on Ubuntu 20.04

What is Python?

Guido van Rossum created Python in 1991. It is an object-oriented programming language. Python is considered attractive for the formation of application development, for integrating different components, and for scripting as well. It is used for various purposes such as system scripting, software development, mathematics, and the development of web applications.

Why Python?

  • It can be executed in an object-oriented, functional or procedural way.
  • Just like the English language Python consists of a simple syntax structure.
  • Its syntax structure provides availability for the programmers for writing programs in fewer lines as compared to other programming languages.
  • Code in Python is executed as soon as it is written in its environment.
  • Python is compatible for many operating systems such as Linux, Raspberry pi, Windows, Mac, etc.

In this article, you are going to learn how you can install Python 3.9 on Ubuntu 20.04. It’s better to know some major features of Python 3.9 before moving ahead.

What’s New in Python 3.9?

Python 3.9 comprises new syntax features, Interpreter improvements, new library modules, new built-in features, and new features in the standard library as well. Some of them are given below:

  • New PEG parser of CPython.
  • Variable annotations and flexible functions.
  • Reliability in grammar restrictions.
  • Union Operator in dict.
  • Fastest access from methods to module state of C extension types.

That’s the most comprehensive information you should know before Installing and using ‘Python 3.9’. Now let’s move on to its Installation process on Ubuntu 20.04.

Note: To follow the installation, make sure that you are a ‘superuser’ or ‘root’ as the superuser provides unrestricted access to all the commands, files, resources, and directories.

Install Python 3.9 on Ubuntu 20.04

Step 1: First of all, Open up the terminal by searching it manually in activities, or you can also press ‘CTRL+ALT+T’ to view the terminal window.

Step 2: Now update the package lists.

$ sudo apt-get update

Enter your password to allow the process for packages updates.

Also, install these prerequisites.

$ sudo apt install software-properties-common

Enter ‘Y’ to allow the process to continue.

Step 3: In this step, we are going to add the deadsnakes PPA on our Ubuntu 20.04 sources list.

$ sudo add-apt-repository ppa:deadsnakes/ppa

Press ‘Enter’ to continue.

Step 4: As the repository is added and enabled, now we will install Python 3.9 by writing-out the following command in your terminal.

$ sudo apt install python3.9

Enter ‘y’ to allow the installation process to continue.

Step 5: Confirm the version of installed Python on your system by executing the command given below.

$ python3.9 --version

Now you have Python 3.9 on your Ubuntu 20.04. You can execute different scripts of Python to check its working.

Conclusion:

In this article, we have discussed Python 3.9, its features, and its uses. Furthermore, we have also shared its Installation method on Ubuntu 20.04 step by step.