pyenv+virtualenv on High Sierra


  • Install pyenv on Macos High Sierra
brew update
brew install pyenv
brew install pyenv-virtualenv
  • Install required python version:
export CFLAGS="-I$(brew --prefix openssl)/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib"
pyenv install

  • add to bashprofile
###PYENV 
export PYENV_ROOT=/usr/local/opt/pyenv
eval "$(pyenv init -)"
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
alias pyt='pyenv activate'
alias pys='pyenv shell'
alias pyd='pyenv deactivate'
alias pyu='pyenv uninstall' #delete virtualenv
alias pyv='pyenv virtualenv' #create virtualenv
alias pyls='pyenv virtualenvs' #list virtualenvs
export PYENV_VIRTUALENV_DISABLE_PROMPT=1 #disable deprecated future






pyenv+virtualenv on High Sierra

Install pyenv on Macos High Sierra brew update brew install pyenv brew install pyenv-virtualenv Install required python version: ...