If you want to Install Python on Ubuntu systems for development, automation, or scripting, Ubuntu 26.04 already gives you a solid starting point. The operating system ships with Python 3.14 by default, making it easier to begin coding immediately.
However, many developers still need additional tools like pip, virtual environments, or alternate Python versions for modern projects. This guide explains the safest and most effective ways to install and manage Python on Ubuntu 26.04.
A proper Install Python on Ubuntu setup helps developers manage dependencies, isolate projects, and work with different Python releases without affecting the system environment.
Ubuntu includes Python for internal services, so replacing the default interpreter is never recommended. Instead, developers should install additional versions separately and use virtual environments for project isolation.
To verify the default version installed on your server or desktop, run:
python3 --version
Most Ubuntu 26.04 systems return Python 3.14.x.
For most users, the easiest approach is installing the official Ubuntu Python tools.
First, update the package list:
sudo apt update
Then install pip and the virtual environment module:
sudo apt install python3-pip python3-venv
After installation, verify everything works correctly:
python3 --versionpip3 --version
Next, create a virtual environment for your project:
python3 -m venv myproject
Activate it with:
source myproject/bin/activate
Using virtual environments keeps project dependencies isolated from the system Python installation.
Sometimes applications require a different Python release. In that case, the Deadsnakes PPA provides additional versions such as Python 3.13 or preview builds like Python 3.15.
Add the repository:
sudo add-apt-repository ppa:deadsnakes/ppasudo apt update
Install Python 3.13:
sudo apt install python3.13
You can confirm the installation using:
python3.13 --version
If needed, install the matching venv package:
sudo apt install python3.13-venv
This method allows developers to test applications across multiple Python environments safely.
Advanced users may prefer compiling Python manually. This approach gives full control over optimization and version selection.
Start by installing the required dependencies:
sudo apt install build-essential libssl-dev zlib1g-dev wget
Download the source package directly from python.org and extract it.
After entering the source directory, configure and compile Python:
./configure --enable-optimizationsmake -j $(nproc)
Finally, install it safely:
sudo make altinstall
Using altinstall prevents Ubuntu’s default Python interpreter from being overwritten.
Choosing the right way to Install Python depends on your workflow and project requirements. For most users, Ubuntu’s default Python with pip and virtual environments works perfectly.
Meanwhile, developers needing multiple Python versions can rely on the Deadsnakes repository, while advanced users can compile Python from source for maximum flexibility and control.
Managing virtual mail users manually can quickly become difficult on a busy mail server. That’s…
Managing administrative access properly is essential for every Linux system. When you Add User Sudoers…
Installing Google Chrome on Ubuntu systems is a simple process that gives users access to…
Setting up a LAMP Stack Ubuntu server is one of the fastest ways to host…
Keeping your system credentials updated is one of the simplest ways to improve Linux security.…
A fresh Linux VPS may look ready to use immediately, but skipping the initial security…