Install pyenv using homebrew:
$ brew install pyenv
Install multiple versions of python:
$ pyenv install 3.2.6 3.3.6 3.4.3
In your ~/.profile, add:
# pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
# PATH for python
PATH=/usr/local/share/python:${PATH}
# for homebrewed bottles
PATH=/usr/local/bin:/usr/local/sbin:${PATH}
# for custom scripts
PATH=$HOME/bin:${PATH}
# for pyenv
PYENV_ROOT=$HOME/.pyenv
PATH=$PYENV_ROOT/bin:${PATH}
export PATH
In virtualenv directory:
$ pyenv local 3.2.6 3.3.6 3.4.3
Thanks, very helpful. I do
pyenv local my_env_with_tox 2.7.12 3.4.2 3.5.2 3.6.0
so that the original versions are kept clean