How To Download Python 3 On Ubuntu 20.04
According to Python’s docs, Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built-in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components. In this tutorial, I will show you How to Download Python 3 on Ubuntu 20.04, following this guide, you can install python on ubuntu easily.
Prerequisites to install Python 3?
- Operating system: Linux - Ubuntu 16.04, 18.04 to 20.10 with 2GB RAM (4GB preferable)
- You can use a Linux Terminal to run Linux script
- A user account with sudo privileges
Option 1: Download Python 3 on Ubuntu using APT (Easier)
As we knew, APT or Advanced Package Tool is the default package manager that you will find on Ubuntu. You can download the Python package from the official Ubuntu repository. Here’s how to do it.
Step 1: Open up your terminal emulator
Firstly, We need to open your linux terminal to run any command. If you don’t have any terminal, please follow this to Install Alacritty Terminal Emulator on Ubuntu
Step 2: Update the latest versions of the packages
Make sure that all your Ubuntu’s packages can be downloaded the latest version.
sudo apt-get update
Step 3: Download the latest version of Python 3
Now you can start the installation of Python 3.9 with the command.
sudo apt install python
After installing Python 3, don’t forget to check Python’s version to ensure everything is working correctly.
python --version
If you get something like this. It means Python is installed on your Ubuntu.
Python 3.9.7
Option 2: Download latest Python on Ubuntu use Deadsnakes PPA
Personal Package Archives (PPAs) are software repositories designed for Ubuntu users and are easier to install than other third-party repositories. PPAs are often used to distribute pre-release software so that it can be tested.
Step 1: Install the above-mentioned package on your Ubuntu
Firstly, make sure your linux machine can use PPAs. If this package is not installed on your Linux, you can install by running this command:
sudo apt-get install software-properties-common
Step 2: Add the official Deadsnakes PPA link to your Linux’s repository list
After that, you can now install Python PPA on Ubuntu:
sudo add-apt-repository ppa:deadsnakes/ppa
The system will prompt you to press enter to continue.
Step 3: Download the latest version of Python from the added PPA
Now you can start the installation of Python 3 with this command.
sudo apt update
sudo apt install python3
Don’t forget to check Python’s version.
python --version
Option 3: Download Python 3 on Ubuntu 20.04 from Source Code
Although downloading and building the latest version of Python from the official Python website seems a bit daunting to you at first, it’ll become easier once you know the process.
Step 1: Update your system’s local repository list
First of all, you need to make your Ubuntu’s packages can be downloaded the latest version.
sudo apt update
Step 2: Install Python’s dependencies on your Ubuntu using APT
sudo apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
Step 3: Create a new directory to store the Python source files
mkdir /python && cd /python
Step 4: Download the Python source code from the official FTP server
wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
Step 5: Extract the TGZ file that you just downloaded
tar –xf Python-3.9.7.tgz
Step 6: Build the package using the MakeFile present in the directory
sudo make install
Conclusion
Programming languages have become important because of the growing demand for developers across industries. The Python language is used in a variety of different sectors, and its applications are enough to demonstrate how powerful it is. Python comes preinstalled on almost every Linux system and it is also available on official distribution repositories. If you still don’t get Python installed on your computer, then you can easily download it by follow this guide How To Download Python 3 On Ubuntu 20.04.