Skip to content

Instantly share code, notes, and snippets.

@mataralhawiti
Created January 28, 2026 10:02
Show Gist options
  • Select an option

  • Save mataralhawiti/846452b0f5532f7575a05ca8b8121e56 to your computer and use it in GitHub Desktop.

Select an option

Save mataralhawiti/846452b0f5532f7575a05ca8b8121e56 to your computer and use it in GitHub Desktop.
python3.12-macos
# macOS Python 3.12 Setup Guide (Homebrew)
This guide walks through installing Python 3.12 on a modern MacBook (Apple Silicon) and correctly configuring the shell path to override the default system Python 3.9.
## Step 1: Install Python 3.12
brew install python@3.12
# update zshrc
nano ~/.zshrc
# Homebrew Environment Setup
eval "$(/opt/homebrew/bin/brew shellenv)"
# Prioritize Python 3.12 libexec (provides 'python3' and 'pip3' links)
export PATH="/opt/homebrew/opt/python@3.12/libexec/bin:$PATH"
# Refresh the shell
source ~/.zshrc
# Verification
which python3
python3 --version
#global alias
alias python="python3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment