brew update
brew install pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
pyenv versions
pyenv install -l
pyenv global 3.6.5
brew install pyenv-virtualenv
eval "$(pyenv virtualenv-init -)"
pyenv virtualenv 3.6.5 <env_name>
pyenv virtualenvs
pyenv uninstall <env_name>
pyenv activate <env_name>
pyenv deactivate <env_name>
or use .python-version
file