pyenv
pyenv is a Simple Python Version Management, lets you easily switch between multiple versions of Python(like nvm).
Tip
To use pyenv on Windowns, use pyenv-win
Install
brew install pyenv
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
Commands
List All Available Versions
Install Specific Version
List Installed Versions
# Lists all Python versions known to pyenv, and shows an asterisk next to the currently active version.
pyenv versions
Switch Versions
pyenv shell <version> # select just for current shell session
pyenv local <version> # automatically select whenever you are in the current directory (or its subdirectories)
pyenv global <version> # select globally for your user account
Display Full Path to Executable
pyenv which python # display full path to executable that pyenv will invoke when you run the given command
Uninstall
pyenv-virtualenv
pyenv-virtualenv is a pyenv plugin to manage virtualenv (a tool to create isolated Python environments).