Credit to Christian Perez (https://github.com/chris-zen)
NOTE: I ran into several problems with this guide with Mojave (macOS 10.14). Then needed to follow this other one first to solve them: https://swapps.com/blog/how-to-configure-virtualenvwrapper-with-python3-in-osx-mojave/
brew install zlib pyenv
xcode-select --install
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 2.7.14
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.7.3
pyenv global 2.7.14 3.7.3
https://github.com/pyenv/pyenv-virtualenvwrapper
brew install pyenv-virtualenvwrapper
# Pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
pyenv virtualenvwrapper_lazy
mkvirtualenv test_env
workon
workon test_env