- pyenv is used to manage which version of python you are using
- virtualenv is used to manage python dependencies
They can interact nicely together if you do the following:
Install the required packages (this assumes that you have virtualenv and virtualenvwrapper installed).
Install pyenv and pyenv-virtualenvwrapper
brew install pyenv
brew install pyenv-virtualenvwrapper
Add export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"
to your ~/.bashrc or ~/.zshrc file, then source ~/.zshrc
(or ~/.bashrc).
Set up a specific python version
mkdir <dir>
cd <dir>
pyenv install 3.4.6
# Fix local version of Python
pyenv local 3.4.6
mkvirtualenv -a ./ example_virtualenv