Installing Python

Python is the language we'll use throughout this curriculum. It's beginner-friendly, widely used in industry, and excellent for learning programming concepts that transfer to any language.

One important note: you need Python 3, not Python 2. Python 2 reached end-of-life in 2020 and shouldn't be used for new projects. When you see python3 in commands, that's ensuring you're using the right version.

Installing Python

  1. Visit python.org/downloads
  2. Download the latest Python 3 release
  3. Run the installer
  4. Important: Check the box that says "Add Python to PATH" before clicking Install

This PATH setting lets you run Python from any terminal window. Without it, your computer won't know where to find Python.

After installation, open a new Command Prompt or PowerShell window and verify:

python --version

You should see something like Python 3.12.0.

macOS comes with Python, but it may be outdated. The recommended approach is using Homebrew:

brew install python3

If you don't have Homebrew, you can download Python directly from python.org/downloads.

Verify the installation:

python3 --version

On macOS, you'll typically use python3 rather than python to ensure you're using Python 3.

Most Linux distributions include Python 3. Check if it's already installed:

python3 --version

If not installed, use your package manager:

# Debian/Ubuntu
sudo apt install python3

# Fedora sudo dnf install python3

Verifying Your Installation

Open your terminal and run the version check command for your system. If you see a version number starting with 3 (like Python 3.11.4), you're ready to go.

What Is PATH?

When you type a command like python3, your computer searches through a list of folders to find that program. This list is called the PATH. Adding Python to PATH means your computer knows where to find it.

If you get "command not found" errors, PATH is usually the culprit. Reinstalling with the PATH option checked typically fixes this.

See More

You need to be signed in to leave a comment and join the discussion