Skip to main content
macOS ships with a system Python that Apple uses for internal purposes. You should leave that version untouched and install your own Python 3 alongside it. There are two popular approaches: downloading the official installer from python.org (the simplest path) or using the Homebrew package manager (preferred if you already use Homebrew for other tools). Both options are covered below — choose the one that suits you.

Check what you already have

Before installing, it is worth checking whether a suitable Python 3 is already present on your machine. Open a Terminal window (Cmd + Space, type “Terminal”, press Enter) and run:
If you see a recent Python 3 version (3.10 or later is fine for this course), you may already be set. If the command is not found, or the version is older than you’d like, continue with the installation steps below.
Never rely on the python command on macOS without checking what it points to — on some systems it invokes Python 2, which is end-of-life. Always use python3 unless you have explicitly configured an alias.

Option A: Official installer from python.org

This is the recommended approach for most learners.
1

Download the installer

Go to python.org/downloads. The site detects macOS and shows the latest stable release. Click the download button to get the .pkg file.
Always download from the official python.org website to ensure you receive the signed, verified release.
2

Run the package installer

Open the downloaded .pkg file. The Python installer will launch. Click through the following screens:
  1. Introduction — click Continue.
  2. License — click Continue, then Agree.
  3. Installation Type — click Install.
  4. Enter your Mac password when prompted.
  5. Wait for the progress bar to finish.
  6. Click Close when you see “The installation was successful”.
3

Install SSL certificates

After the installer closes, look in your Applications folder for a folder named Python 3.x. Inside it, double-click Install Certificates.command to run it. This is necessary for making HTTPS requests from Python — which you will do when calling AI APIs.
Skipping the certificate install causes ssl.SSLCertVerificationError errors when your code tries to reach any HTTPS endpoint. Run the command now to avoid this later.
4

Open a new Terminal window

Close your current Terminal window and open a fresh one. This ensures the shell picks up the updated PATH that the installer wrote to your profile.
5

Verify the installation

You should see the version you just installed. Also confirm pip3 is available:
6

Test the interpreter

Launch the Python REPL:
You will see the >>> prompt:
Try a command:
Exit with exit() or Ctrl + D.

Option B: Homebrew installation

If you use Homebrew to manage tools on your Mac, installing Python through it keeps everything managed in one place.
1

Install Homebrew (if not already installed)

Open Terminal and run:
Follow the on-screen prompts. On Apple Silicon Macs (M1/M2/M3), Homebrew installs to /opt/homebrew/ — the installer will tell you to add it to your PATH and show you the exact command to run.
2

Install Python

Homebrew will install Python 3 and create symlinks in /opt/homebrew/bin/ (Apple Silicon) or /usr/local/bin/ (Intel).
3

Verify the installation

Open a new Terminal window, then:
Homebrew Python lives in a different directory than the python.org installer. Both work correctly for this course. If you later see tools pointing to the wrong Python, which python3 will show you exactly which binary is being used.

Troubleshooting

The most common cause is that your shell’s PATH was not updated yet.Step 1: Close Terminal completely (Cmd + Q) and open a new window, then try again.Step 2: If still not found, check that Python is installed:
Step 3: Add Python to your PATH manually. For Zsh (the default macOS shell since Catalina):
For Bash (older macOS or custom setup):
This is expected behaviour on macOS — the python command is not created automatically to avoid conflicts with the system Python. You have two options:Option 1 (recommended): Always type python3. It’s a small habit change and keeps things unambiguous.Option 2: Create a shell alias so python maps to python3:
If you see errors like ssl.SSLCertVerificationError when running Python code that makes HTTPS requests:Fix 1: Run the certificate installer that comes with Python:
Fix 2: Install or upgrade the certifi package:
If you have more than one Python version installed, you can call a specific one by including the version number:
To see all installed versions:
For advanced version management across projects, consider pyenv, which is installable via Homebrew:

Next steps

Continue to VS Code Introduction

Install and configure Visual Studio Code as your Python editor.