--Enables independent management of multiple versions of python for each development environment
pyenv --A tool for switching versions of multiple versions of Python environment according to the purpose
pyenv-virtualenv --Pyenv plugin that allows you to switch environments between the same versions, which is not possible with pyenv
--Using zsh on OSX --Use homebrew
pyenv --clone from github
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
--Added to ./zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
pyenv-virtualenv --Install virtualenv from homebrew
brew install pyenv-virtualenv
--Check the installable version
pyenv install -l
--Installation (the following is for python2.7.10)
pyenv install 2.7.10
--Need to rehash after installation
pyenv rehash
--Check available versions (environment where * mark is in use)
pyenv versions
--Prepare an alias environment with the same version of python using virtualenv (create 2.7.10_sand below)
pyenv virtualenv 2.7.10 2.7.10_sand
--Set the environment for each directory (the following is set to 2.7.10_sand)
pyenv local 2.7.10_sand
Recommended Posts