Download and Install Python on Windows, macOS, and Linux
Here is a step-by-step guide to download and install Python on your Windows, Mac, and Linux:
Table of Contents
Installing Python on Windows
Step 1: Download Python Installer
- Go to the official Python website: https://www.python.org/downloads/
- Click “Download Python 3.x.x” (the latest stable version).
Step 2: Run the Installer
- Locate the downloaded file (e.g.,
python-3.13.7-amd64.exe
) and double-click to open it. - Important: Check the box that says “Add python.exe to PATH” at the bottom of the installer.
- Click Install Now.
Step 3: Verify Installation
- Open Command Prompt (press
Windows Key + R
, typecmd
, and press Enter). - In the Command Prompt, type the following command and Press Enter:
python --version
Or
py --version
3. If it shows the Python version you just installed (e.g. python-3.13.7
-amd64.exe), it is successfully installed.
Installing Python on macOS
Step 1: Download Python Installer
- Go to the official Python website: https://www.python.org/downloads/
- Click on “Download Python 3.x.x” (the latest stable version). It will download a
.pkg
installer file.
Step 2: Run the Installer
- Locate the downloaded file (e.g., python-3.13.7-macos11.pkg) and double-click to open it.
- Click Continue through the introduction and license screens.
- Accept the license agreement.
- Choose the installation location (default is fine).
- Click Install.
Step 3: Verify the Installation
- Open Terminal (
Cmd + space
, typeTerminal
, and press Enter). - Type
python3 --version
- You should see the installed Python version (e.g.
Python 3.13.7
).
Installing Python on Linux
To install Python on Linux, the exact commands depend on your Linux distribution.
Most modern distributions come with Python 3 pre-installed, but you may want to install a different version or the latest one.
Step 1: Check Your Current Python Version
Opern Terminal and check if Python 3 is already installed using the following command:
python3 --version
If you see a version like Python 3.13.7
or similar, it means Python 3 is alredy installed. If not, or if you need a newer version, proceed with the steps below.
Choose the section for your specific Linux distribution (e.g., Debian, Ubuntu, Fedora, or CentOS).
For Debian, Ubuntu, and their derivatives
These distributions use the apt
package manager.
sudo apt update
sudo apt install python3 # Installs Python 3
sudo apt install python3-pip # Installs pip, the Python Package manager
For Fedora, CentOS, and RHEL
These distributions use the dnf
(or older yum
) package manager.
sudo dnf install python3 # Installs the latest Python 3 available
sudo dnf install python3-pip # Installs pip, the Python package manager
For Arch Linux
sudo pacman -S python python-pip
Step 3: Verify Installation
After the installation is complete, close and reopen the terminal. Run the following commands to confirm that Python and pip
are ready to use.
1. Check the Python Version
python3 --version
OR
python --version
You should see the Python version you installed (e.g. Python 3.13.7).
2. Check the pip Version
pip3 --version
Or
pip --version
This will show you the version of pip that was installed.