xxxxxxxxxx
No pyenv needed, this works perfect for me:
brew install python@3.7
brew install python@3.8
brew install python@3.9
Then just add the corresponding version lines to the ~/.bashrc
export PATH="$PATH:/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/bin"
export PATH="$PATH:/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/bin"
export PATH="$PATH:/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin"
Install Multiple Python Versions on Mac
xxxxxxxxxx
# Install pyenv
brew install pyenv
# Install Python
pyenv install 3.9.0
# Get a list of available versions in the repo:
pyenv install --list
# Install another version.
pyenv install 3.8.6
# make python version 3.9.0 as the default version
pyenv global 3.9.0