brew install python@3.12 Homebrew installs Python to /opt/homebrew/bin/python3 (Apple Silicon) or /usr/local/bin/python3 (Intel). After installing, check the version again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" update python mac
which -a python3 If you work on different projects, use pyenv to switch between Python versions without conflicts. brew install python@3
via Homebrew: