Install Python on Ubuntu

Ubuntu: Install Python

Python is a versatile programming language widely used for web development, automation, and data science. This guide explains how to install Python and pip on Ubuntu.


Step 1: Update Package Lists

sudo apt update


Step 2: Install Python

sudo apt install python3 -y

sudo apt install python3-pip -y


Step 3: Verify Installation

python3 --version

pip3 --version


Best Practices

  • Use virtual environments (python3 -m venv env) for project isolation
  • Keep pip updated with pip3 install --upgrade pip
  • Use requirements.txt to manage dependencies