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:
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.2
Run the package installer
Open the downloaded
.pkg file. The Python installer will launch. Click through the following screens:- Introduction — click Continue.
- License — click Continue, then Agree.
- Installation Type — click Install.
- Enter your Mac password when prompted.
- Wait for the progress bar to finish.
- 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.
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
pip3 is available:6
Test the interpreter
Launch the Python REPL:You will see the Try a command:Exit with
>>> prompt: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
/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
'python3' command not found after installation
'python3' command not found after installation
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):
'python' command not found (only 'python3' works)
'python' command not found (only 'python3' works)
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:SSL / certificate verification errors
SSL / certificate verification errors
If you see errors like Fix 2: Install or upgrade the
ssl.SSLCertVerificationError when running Python code that makes HTTPS requests:Fix 1: Run the certificate installer that comes with Python:certifi package:Managing multiple Python versions
Managing multiple Python versions
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.