/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install pyenv
Add pyenv init to your shell to enable shims and autocompletion. Please make sure eval "$(pyenv init -)" is placed toward the end of the shell configuration file since it manipulates PATH during the initialization.
The following command should do it for you.
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
Restart your shell so the path changes take effect. You can now begin using pyenv.
Install python 2.7.13 and make it the global python
pyenv install 2.7.13
pyenv global 2.7.13
brew install pyenv-virtualenvwrapper
Add the virtualenvwrapper initialization to your shell.
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n pyenv virtualenvwrapper\nfi' >> ~/.bash_profile
Restart your shell.