-
-
Save mataralhawiti/846452b0f5532f7575a05ca8b8121e56 to your computer and use it in GitHub Desktop.
python3.12-macos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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