Skip to main content

Check existing Python

macOS includes an older Python version for system use. Let’s check what you have:
  1. Open Terminal:
    • Press Cmd + Space to open Spotlight
    • Type “Terminal” and press Enter
    • Or find Terminal in Applications > Utilities
  2. Check Python version:
If you see a recent Python 3 version, you might already be set!
Some Mac users can use just python instead of python3, but this depends on your system configuration. When in doubt, use python3.

Download Python

  1. Go to python.org/downloads
  2. The site will detect you’re on macOS and show the latest version
  3. Click the download button to get the .pkg installer
Always download from python.org to ensure you get the official, secure version.

Install Python

  1. Open the downloaded .pkg file
  2. The Python installer will open
  3. Click “Continue” through the introduction and license screens
  4. Click “Agree” to accept the license
  5. Click “Install” (you’ll need to enter your Mac password)
  6. Wait for installation to complete
  7. Click “Close” when you see “The installation was successful”

Verify installation

Open a new Terminal window (important!) and check the version:
You should see the version you just installed. The exact number depends on when you download.

Test Python

Let’s make sure Python works properly:
  1. In Terminal, type:
  1. You’ll see something like:
  1. Try your first Python command:
  1. Press Enter and you should see:
  1. To exit Python:
    • Type exit() and press Enter
    • Or press Ctrl + D

Troubleshooting

The Terminal might not see the new installation yet.

Solution 1: Close Terminal completely and open a new window.

Solution 2: Check if Python is installed but not in PATH:
Solution 3: Add Python to your PATH manually:
This is normal on macOS. You have three options:

Option 1: Always use python3 (recommended)

Option 2: Create an alias:
Option 3: Check if the installer created a python link:
You forgot to install certificates. Fix it by

Running from Terminal:
Or manually installing certificates:
macOS can have multiple Python versions. To manage them:

See all installed versions:
Use a specific version:
Set a default (example for 3.13):

Alternative: Homebrew installation

If you prefer using a package manager:
1

Install Homebrew

2

Install Python

3

Verify installation

Homebrew Python might use different paths than the official installer. Both work fine.

Next steps

Perfect! Python is now installed on your Mac. Let’s set up your code editor.

Continue to VS Code introduction

Install and configure Visual Studio Code