Install
Install pre-requisites
xcode-select --install
brew update && brew install openssl readline sqlite3 xz zlib tcl-tk
Install pyenv
Install pyenv with Homebrew.
brew install pyenv
Now, configure your shell environment.
Install Python versions
List Python choices.
pyenv install -l
Filter the list. For example, list all available Python 3.9.x versions:
pyenv install -l | grep 3.9
Install a Python version, like python_version="3.9.5"
.
pyenv install ${python_version}
Install other needed Python versions. You can now switch between them with pyenv or Poetry .