# Check Python versions
~ type -a python
python is /usr/bin/python
~ which python
/usr/bin/python
~ python --version
Python 2.7.16# Update Homebrew and Install pyenv (Assumption is that you've already Homebrew installed in your OS)
~ brew update
~ brew install pyenv
# Open your .zshrc (or .bashrc) file with a code editor e.g. nano
~ nano ~/.zshrc
# Add below comment to your zsh profile in order to set pyenv version as your global python version
~ eval "$(pyenv init --path)"https://stackoverflow.com/questions/33321312/cannot-switch-python-with-pyenv
# List all installable versions and choose one
~ pyenv install --list
~ pyenv install 3.8.12
# List all available versions in your system
~ pyenv versions
# See global python version
~ pyenv global
# Set your global python version
~ pyenv global 3.8.12
# Check global python version
~ python --version
# To uninstall a specific python version
~ pyenv uninstall 3.8.12
# pyenv install path
~/.pyenv/versions
https://github.com/pyenv/pyenv
https://laict.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9