Installing Python on Ubuntu/Debian-based Distributions
=======================================================
Step 1: Open the Terminal
--------------------------
You can open the terminal by pressing Ctrl + Alt + T.
Step 2: Update Package List
---------------------------
Run the following command to ensure your system package list is up to date:
sudo apt update
Step 3: Check if Python is Already Installed
--------------------------------------------
Most Ubuntu/Debian systems come with Python pre-installed.
To check the installed version:
python3 --version
If Python 3 is installed, you'll see something like:
Python 3.10.12
Step 4: Install Python 3
------------------------
If Python 3 is not installed, run:
sudo apt install python3
Step 5: (Optional) Install pip (Python Package Installer)
----------------------------------------------------------
To install pip for Python 3:
sudo apt install python3-pip
Verify pip installation:
pip3 --version
Step 6: (Optional) Install Python Development Tools
---------------------------------------------------
For compiling Python modules, install:
sudo apt install python3-dev python3-venv build-essential
Step 7: Verify Installation
---------------------------
Check Python version again to confirm:
python3 --version
To launch Python shell:
python3
You can now run Python commands directly in the terminal.
Done!
-----
Python is now installed and ready to use on your Ubuntu/Debian-based system.