python programming tutorial windows linux macos installation

How to Install Python on Windows, Linux, and macOS: A Step-by-Step Beginner's Guide

Learn to install Python on any operating system with this practical guide. From official downloads to verifying everything works correctly.

Hands typing Python code on a laptop, with a dark development environment and bokeh lights in the background.
· Crezendo

Python is the most popular programming language for beginners. It's used in web development, data analysis, artificial intelligence, automation, and many other fields. Best of all, it's completely free and installing it on your computer takes less than 10 minutes.

This guide shows you step by step how to install Python on Windows, Linux, and macOS — without assuming you already know anything about programming.

Before you start: Do you already have Python installed?

Open your terminal or command prompt and type:

python --version

Or on some systems:

python3 --version

If you see something like Python 3.12.0, you're all set. If it says the command doesn't exist, follow this guide.

How to install Python on Windows

Step 1: Download the installer

Go to python.org/downloads and click the yellow button that says "Download Python". The site will automatically detect that you're using Windows.

Step 2: Run the installer

Open the downloaded file. Important: before clicking "Install Now", check the box that says "Add Python to PATH". Without this, your computer won't recognize the python command from anywhere.

Step 3: Verify the installation

Open Command Prompt (CMD) and type:

python --version

You should see the version you just installed.

Step 4: Test that it works

Type:

python

You'll see a prompt with >>>. Type:

print("Hello, world")

Press Enter. If you see Hello, world, everything works. To exit, type exit() and press Enter.

How to install Python on macOS

Step 1: Check if it's already installed

macOS usually comes with Python 2.7 preinstalled, but that version is very old. Open Terminal and type:

python3 --version

If you see a 3.x version, you're ready. If not, continue.

Step 2: Install with Homebrew (recommended)

If you don't have Homebrew, install it by typing this in Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then install Python:

brew install python

Step 3: Verify

Type:

python3 --version

On macOS, always use python3 instead of python.

How to install Python on Linux

Most Linux distributions come with Python preinstalled. To verify:

python3 --version

If you don't have it or want to update:

Ubuntu/Debian:

sudo apt update
sudo apt install python3 python3-pip

Fedora:

sudo dnf install python3 python3-pip

Arch Linux:

sudo pacman -S python python-pip

What is pip and why does it matter?

pip is Python's package manager. It lets you install libraries created by other people with a single command. For example:

pip install requests

On Linux and macOS, use pip3 instead of pip.

First steps after installing Python

Now that you have Python, here are three ways to start practicing:

  1. Write scripts in a text file with the .py extension and run them with python file.py.
  2. Use the interactive console by typing python or python3 in the terminal.
  3. Install a code editor like Visual Studio Code (free) to get syntax highlighting, autocompletion, and error detection.

If you don't have a computer to practice on

At Crezendo, we know that many people in Latin America want to learn programming but don't have access to a computer. That's why we accept donations of laptops, desktop computers, and equipment in any condition. Working equipment goes directly to students. Non-working equipment becomes teaching material for our repair courses.

If you have an old laptop you no longer use, or know someone who wants to learn Python but doesn't have equipment, write to us. Transforming lives through technology education is exactly why we exist.