How to install Python in Ubuntu?
Last Updated :
23 Jul, 2025
This guide will walk you through the steps to install Python on Ubuntu. Python 3 is widely used and usually comes pre-installed on most Ubuntu versions. However, if it's not available or you want to install a specific version, follow any of the methods below.
Note: Python 3 is typically pre-installed in Ubuntu, especially in versions like 20.04, 22.04, and 24.04.
However, if Python is not pre-installed on Ubuntu, you can use various methods through the Linux terminal or the command line. This guide will outline these methods to help you get started with Python programming effortlessly.
How to install Python in UbuntuMethod 1: Install Python on Ubuntu using APT Installer
In the below section, we will discuss the step-by-step process to install the Python on Ubuntu also the process you are going to opt here is compatible with Ubuntu 20.04, 22.04 and 24.04.01.
Step 1: First Update the List of Available Packages
- Open the Linux Terminal & execute the following Linux Command that will update all the packages installed there.
sudo apt update
sudo apt updateStep 2 Update the Available Package
- After executing the update command, you have to execute upgrade command and to do the follow the below command.
sudo apt upgrade
sudo apt upgrade- Now, directly paste the following command in the Terminal & execute it. It will directly download the latest Python File.
sudo apt install python[version number]

Replace [version number] with the Python version you want to be installed in your Ubuntu system.
Method 2: Install Python on Ubuntu using Repository
Step 1: Access the Python Module
- On the Linux Terminal, the following command will be used. It will start accessing the Repository of the Python Module.
sudo apt install software-properties-common

Step 2: Download the Python Package from the official Website
- Now, the following command execution will download the Python Package on the device.
sudo add-apt-repository ppa:deadsnakes/ppa

Step 3: Run Install Command to Install Python
- Execute the following command to get any version of Python, even some older ones on your Ubuntu device.
sudo apt install python[version number]

Method 3: Install Python on Ubuntu using the Source Link
Step 1: Download Python for Python Official Website
- Browse to the Official Python Page & copy the Gzipped Source Tarball link for any version.
Step 2: Open Ubuntu Terminal
- Paste the link in the Linux Terminal as the following.
sudo wget <Copied Link>

Step 3: Download TGZ File
tar -xf <TGZ File Name>.tgz

- Now, the following command should be executed to Configure the extracted file before installation.
./configure --enable-optimizations

Step 5: Install Python
- At last, the follow the below command to Directly Install the file on the Ubuntu system.
sudo make install

Conclusion
By following the steps outlined in this guide, you can easily install Python in Ubuntu and set up your development environment. Whether you're using the default Python installation that comes with Ubuntu or you want to install a specific version, this process is straightforward and efficient. Having Python installed on your Ubuntu system opens up a world of programming possibilities, from web development to data science.
Similar Reads
How to Install PyCharm in Ubuntu PyCharm is one of the most popular Python-IDE used for performing scripting and executing Python programs. It supports a wide range of frameworks and has a lot of useful features like Code Completion and inspection, debugging process, and support for various programming frameworks such as Flask and
2 min read
How to install PIP in Ubuntu? PIP is the most widely used package management system for Python, allowing you to install and manage Python libraries and packages easily. If you're developing in Python on Ubuntu, having PIP installed is essential for downloading and managing the dependencies of your projects. In this guide, weâll
3 min read
How to Install Python-Peewee on Ubuntu? Peewee is a small and easy-to-use ORM. It has some, but expressive concepts that make it easy to use and understand. It is supported by Python 2.7+ and 3.4+. It supports SQLite, MySQL, PostgreSQL, and cockroach DB. It also supports various types of extensions modules that come under the playhouse na
2 min read
How to Install Python-PyGreSQL on Ubuntu? Python-PyGreSQL is a python module that interfaces to the popular PostgreSQL database. Python-PyGreSQL implants the PostgreSQL database query library to permit simple use of the powerful PostgreSQL features from Python script. In this, article, we will look into the steps of installing the Python-Py
2 min read
How to Install PyQt for Python3 on Ubuntu? PyQt is a Python binding of the cross-platform GUI toolkit Qt. It is implemented as a Python plug-in and developed by the British firm Riverbank Computing. It implements approximately 440 classes and 6,000 functions and methods. It is not installed by default, so to use this we have to install it in
2 min read
How to Install python3-s3transfer on Ubuntu? S3transfer is a Python library. It is used for managing Amazon S3 transfers. In this article, we will be looking at the step-wise procedure to install the python3-s3transfer for Python in Linux. Installing Python3-s3transfer on LinuxFollow the below steps to install Python3-s3transfer in Linux: Step
2 min read