- Installing Python On Ubuntu 20.04
How To Install Python On Ubuntu 20.04?
One of the fastest, interpreted, object-oriented, and high-level programming languages, Python, is mainly used for software development. This programming language is quite easier to learn when compared to the other languages. It is used by both beginners and experienced people for software development. This article explains how to install Python on Ubuntu 20.04.
You can install Python on your Ubuntu 20.04 device in two different ways.
Using apt (Note: The apt software package helps you to identify, install, and remove any software on Ubuntu) or Using the source code.Both methods are quite simple and easy to perform. Scroll down this page to know how to install the Python on Ubuntu 20.04 using the apt software package and the source code.
Method 1: Using the ‘apt’ software package
- Initially, download the Python software package that meets your system requirements.
- Open the Terminal application on your Ubuntu computer.
- Begin the installation process by updating the packages list. To do so, run the following command in the Terminal window.
$ Sudo Apt Update
Once the update is complete, install the apt software by running the below command.
$ sudo apt install software-properties-common
- Now, the apt software installation will be initiated on your Ubuntu computer. Once apt has been installed, you have to include the deadsnakes PPA of the software to your Ubuntu computer’s source list.
- To do so, run the $ sudo add-apt-repository ppa:deadsnakes/ppa command.
- Tap Enter.
- Now, the repository of the installation package will be enabled on your computer.
- Install the Python software by running the command $ sudo apt install python 3.9.
- Once the installation is done, check it using the command $ python3.8 -version.
- If the output is Python 3.9.1+, then it means the installation is done successfully.
Method 2: Using The Source Code
- Initially, download the Python source code with wget.
- Now, to install the Python on Ubuntu 20.04 using the source code. First, you have to update the apt software (the steps are given in the previous method).
- After updating the apt software, you can build Python on your Ubuntu computer.
- Before that, install the dependencies that are required to build Python.
- In the Terminal window, type the below command and tap Enter.
$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
- Now, you have to extract the downloaded source code zip file.
- For this, type the command $ tar -xf Python-3.9.1. tgz and tap Enter.
- Configure the Python installation scripts using the $ ./configure -enable-optimization command.
- Now, you can build the Python installation process by running $ make -j 12.
- Wait for the on-going process to complete. Once it is done, install the Python software on your Ubuntu computer using the $ python3.9 -version command.
To get remote assistance on how to install python on Ubuntu 20.04, click the Call button provided on this page.