Getting Started
Install on macOS
Installing Python on Mac computers
Check existing Python
macOS includes an older Python version for system use. Let's check what you have:
- Open Terminal:
- Press
Cmd + Spaceto open Spotlight - Type "Terminal" and press Enter
- Or find Terminal in Applications > Utilities
- Press
- Check Python version:
bash
python3 --versionIf 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
- Go to python.org/downloads
- The site will detect you're on macOS and show the latest version
- Click the download button to get the
.pkginstaller
Always download from python.org to ensure you get the official, secure version.
Install Python
- Open the downloaded
.pkgfile - The Python installer will open
- Click "Continue" through the introduction and license screens
- Click "Agree" to accept the license
- Click "Install" (you'll need to enter your Mac password)
- Wait for installation to complete
- Click "Close" when you see "The installation was successful"
Verify installation
Open a new Terminal window (important!) and check the version:
bash
python3 --versionYou should see the version you just installed.
Test Python
Let's make sure Python works properly:
- In Terminal, type:
bash
python3- You'll see something like:
bash
Python 3.13.5 (v3.13.5:0fa1754080, Jul 29 2025, 09:45:56) [Clang 15.0.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>- Try your first Python command:
bash
print("Hello from Python!")- Press
Enterand you should see:
bash
Hello from Python!- To exit Python:
- Type
exit()and press Enter - Or press
Ctrl + D
- Type
Troubleshooting
Alternative: Homebrew installation
If you prefer using a package manager:
- Install Homebrew
bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Install Python
bash
brew install python@3- Verify installation
bash
python3 --versionHomebrew 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