pyenv
brew install pyenv pyenv-virtualenv
Add this to .bashrc
or .zshrc
:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
To enable auto-activation add to your profile:
if which pyenv-virtualenv-init > /dev/null;
then eval "$(pyenv virtualenv-init -)"; fi
List available python versions: pyenv install --list
List installed python versions, virtual environments: pyenv versions
Install python versions with pyenv: pyenv install <version>
Create virtual env with pyenv:
pyenv virtualenv <version> <name>
pyenv activate <name>
pyenv -m pip install <package name>
pyenv deactivate
Delete a virtual env: pyenv virtualenv-delete <name>
Uninstall a python version: pyenv uninstall <version>