Installing Python (Step-by-Step Guide)
Before you start programming in Python, the first step is to install Python on your computer.
In this guide, you’ll learn in a simple way how to download and install Python on Windows, macOS, and Linux, as well as how to verify your Python installation properly.
Download Python from the official website
The safest and most recommended way to install Python is through its official site:
Download Python here
On the website, you’ll find the latest version of Python 3, which is recommended for most users. You’ll also have access to older versions if you need compatibility with existing projects.
How to Install Python on Windows
Follow these steps to install Python on Windows:
- Download the installer from the official Python page.
- Run the
.exe
file. - Check the box “Add Python to PATH” (very important so it works in the terminal).
- Click on Install Now.
- Once the installation is complete, open the terminal (CMD or PowerShell) and type:
python --version
If a version number appears (for example Python 3.12.0
), it means the installation was successful, and you’re ready to start programming in Python on Windows.
How to Install Python on macOS
To install Python on Mac:
- Download the
.pkg
installer from the official Python website. - Run the installer and follow the steps.
- Open the Terminal app and type:
python3 --version
Important: macOS comes with an older version of Python preinstalled.
That’s why it’s recommended to install the latest version and always use the python3
command.
How to Install Python on Linux
In most Linux distributions, Python comes preinstalled by default. To verify it, open the terminal and type:
python3 --version
If it’s not installed, you can install it with your distribution’s package manager:
- Ubuntu/Debian:
sudo apt update
sudo apt install python3
- Fedora:
sudo dnf install python3
- Arch Linux:
sudo pacman -S python
With this, you’ll have the latest version of Python installed on Linux.
Verify the Python Installation
Regardless of your operating system, you can check if Python is installed correctly by opening the terminal and typing:
python --version
or in some cases:
python3 --version
If a version number appears, it means that Python is installed and ready to use.
Now that you have Python installed, you can move on to your first program: Hello World in Python.