Docs / Programming & Development / How to Install Python 3 on Ubuntu

How to Install Python 3 on Ubuntu

By Admin · Feb 25, 2026 · Updated Apr 24, 2026 · 345 views · 1 min read

Python 3 is pre-installed on most Ubuntu versions, but you may need to install additional tools.

Check Version

python3 --version

Install pip

apt install python3-pip python3-venv -y

Create a Virtual Environment

python3 -m venv /opt/myproject/venv\nsource /opt/myproject/venv/bin/activate\npip install flask  # Example\ndeactivate

Install Specific Version

Use the deadsnakes PPA for other Python versions:

add-apt-repository ppa:deadsnakes/ppa\napt update\napt install python3.12 python3.12-venv -y

Was this article helpful?