>

How to Install Python on Windows, macOS, and Linux (Beginner Guide)

Ali Malek 2026-02-22
3 min

Python is one of the most popular programming languages in the world.
It is used for:

  • Web development
  • Automation
  • Data analysis
  • Machine learning
  • Artificial intelligence
  • Scripting and system tools

If you're starting your programming journey, installing Python is your first step.

This guide will walk you step-by-step through installing Python on:

  • Windows
  • macOS
  • Linux

No prior experience required.


1. How to Install Python on Windows

Step 1: Download Python

  1. Go to the official website: https://www.python.org/downloads/
  2. Click Download Python (the latest version will be suggested automatically).

Note: Only download Python from the official website.


Step 2: Run the Installer

  1. Open the downloaded .exe file.
  2. IMPORTANT: Check the box that says: Add Python to PATH. This step is critical. If you skip it, Windows won’t recognize Python in the command line.

  3. Click Install Now.

  4. Wait until installation completes.
  5. Click Close.

Step 3: Verify Installation

  1. Open Command Prompt.
  2. Type:
python --version

or

py --version

You should see something like: Python 3.12.1. If you see the version number, Python is installed.


2. How to Install Python on macOS

macOS usually comes with an older version of Python, but we want the latest version.

Step 1: Download Python

  1. Visit: https://www.python.org/downloads/
  2. Click Download for macOS.
  3. Download the .pkg installer.

Step 2: Install Python

  1. Open the .pkg file.
  2. Follow the installation wizard.
  3. Click Continue -> Install.
  4. Enter your Mac password if asked.
  5. Finish installation.

Step 3: Verify Installation

Open Terminal and type:

python3 --version

You should see something like: Python 3.12.1. On macOS, you usually use python3 instead of python.


3. How to Install Python on Linux

Most Linux distributions already include Python. But you may want to install or update to the latest version.

Step 1: Check If Python Is Installed

Open Terminal and type:

python3 --version

If you see a version number, Python is already installed.


Step 2: Install Python (If Needed)

Ubuntu / Debian

sudo apt update
sudo apt install python3

Fedora

sudo dnf install python3

Arch Linux

sudo pacman -S python

Step 3: Verify Installation

python3 --version

You should see the installed version.


4. Optional: Install pip (Python Package Manager)

pip is used to install Python libraries.

Check if pip is installed:

pip --version

or

pip3 --version

If not installed:

Windows

Re-run installer and choose Modify -> Ensure pip is selected.

Linux

sudo apt install python3-pip

macOS

python3 -m ensurepip --upgrade

5. Test Python (Your First Code)

Open Terminal or Command Prompt and type:

python

or

python3

Then type:

print("Hello, World!")

Press Enter. If you see "Hello, World!", you're officially running Python. Exit by typing:

exit()

6. Recommended Next Steps

Now that Python is installed, you can:

  • Learn basic syntax
  • Create virtual environments
  • Install libraries like requests, pandas, or Django
  • Start building real projects

Programming is learned by building, not just reading.

Final Thoughts

Installing Python is simple once you know the steps. The key points: - Download from official website - Add Python to PATH (Windows) - Verify installation using terminal - Use python3 on macOS and Linux

Welcome to the Python ecosystem.

Comments (0)

Average Rating

0

0 ratings

Want to rate this tutorial?

Sign in to rate

Please sign in to leave a comment.

No comments yet. Be the first to comment!

More Tutorials