Member-only story
How to Install Python 3 on macOS
Python is a powerful programming language, and macOS comes with Python 2.x pre-installed. However, it’s recommended to use Python 3 for modern development. Here’s a step-by-step guide to installing Python 3 on macOS.
Step 1: Check the Current Python Version
Before installing, check if Python 3 is already installed:
python3 --version
If you see something like Python 3.x.x
, you already have Python 3. If not, proceed with the installation.
Step 2: Install Homebrew
Homebrew is a popular package manager for macOS, making it easy to install software like Python. If you haven’t installed Homebrew yet, run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installation, ensure Homebrew is set up correctly:
brew --version
Step 3: Install Python 3
Use Homebrew to install Python 3:
brew install python3
Once the installation is complete, verify it:
python3 --version