Recently, I'm using python with pyenv, but it was difficult to find out how to use pyenv / pyenv-virtualenv every time, so make a note.
Package installation
$ brew install pyenv
$ brew install pyenv-virtualenv
Add settings
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ pyenv install --list
$ pyenv install 3.5.1
$ pyenv version
$ pyenv versions
$ pyenv global 3.5.1
$ cd PROJECT_DIR
$ pyenv local 2.7.11
$ pyenv version
Python 2.7.11
$ cd ..
$ pyenv version
Python 3.5.1
$ pyenv virtualenv 2.7.11 sandbox27
$ pyenv version
Python 3.5.1
$ pyenv virtualenv sandbox35
$ pyenv virtualenvs
$ pyenv activate <name>
$ pyenv deactivate
Recommended Posts