echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo 'eval "$(pyenv init -)"' >> ~/.zshrc source ~/.zshrc
This installs Python 3.12+ as python3 .
brew install pyenv pyenv install 3.12.2 # (Or whatever latest version is current) pyenv global 3.12.2 upgrade python mac