How to Install Python on Windows, macOS, and Linux (Step-by-Step Guide)

Before you can build anything with Python, you need to make sure it’s installed on your computer. The good news? Many systems already have Python installed — and if not, installing it only takes a few minutes.

In this guide, you’ll learn:

  • How to check if Python is already installed
  • How to install Python on Windows, macOS, and Linux
  • How to confirm everything is working correctly

No prior experience required.


Step 1: Check If Python Is Already Installed

Before installing anything, open a terminal or command line and check whether Python is already available.

Open the Command Line

Windows

  1. Press Windows + R
  2. Type cmd
  3. Press Enter

macOS

  1. Press Command + Space
  2. Type Terminal
  3. Press Enter

Linux

  • Open your terminal (usually Ctrl + Alt + T)

Check the Python Version

Run the following command:

python --version

If that doesn’t work, try:

python3 --version

Interpret the Result

  • You see a version number (for example: Python 3.12.1)
    • Python is already installed — you can skip to the verification step
  • Command not found / not recognized
    • Python is not installed or not available in your system PATH

If Python isn’t installed, continue below for your operating system.


Step 2: Install Python

Installing Python on Windows

1. Download Python

  1. Go to https://www.python.org
  2. Click Downloads
  3. Click Download Python 3.x.x (latest version)

2. Run the Installer

  1. Open the downloaded installer
  2. Important: Check the box
    “Add Python to PATH”
  3. Click Install Now

⚠️ Forgetting to add Python to PATH is the most common Windows mistake.

3. Verify the Installation

Open Command Prompt again and run:

python --version

You should now see the installed Python version.

Installing Python on macOS

macOS often includes an older system version of Python, so installing the latest version is recommended.

Option A: Official Python Installer (Recommended for Beginners)

  1. Go to https://www.python.org
  2. Click Downloads
  3. Download the macOS installer
  4. Open the .pkg file
  5. Follow the installer steps using default settings

Verify Installation

Open Terminal and run:

python3 --version

Option B: Install Using Homebrew (Advanced Users)

If you use Homebrew:

brew install python

Then verify:

python3 --version

Installing Python on Linux

Most Linux distributions already include Python, but you may need to install or update it.

Ubuntu / Debian

sudo apt update
sudo apt install python3 python3-pip

Verify:

python3 --version

Fedora

sudo dnf install python3 python3-pip

Verify:

python3 --version

Arch Linux

sudo pacman -S python python-pip

Verify:

python --version

Step 3: Confirm Python Is Working

Run Python in interactive mode:

python

or on macOS/Linux:

python3

You should see something like:

Python 3.12.1 (main, ...)
>>>

Exit Python by typing:

exit()

Common Issues and Fixes

“python is not recognized” (Windows)

  • Reinstall Python and ensure Add Python to PATH is checked

python doesn’t work but python3 does

  • This is normal on macOS and Linux — use python3

Multiple Python Versions Installed

Check which version is being used:

which python
which python3

Next Steps

Now that Python is installed, you’re ready to:

  • Write your first Python script
  • Install packages using pip
  • Create virtual environments
  • Build real projects

Leave a Comment

Your email address will not be published. Required fields are marked *