pip install virtualenv virtualenvwrapper
.bashrc or .zshrc
source /usr/local/bin/virtualenvwrapper.sh
When you want to create a virtual development environment
mkvirtualenv python2.7 -p /usr/local/bin/python
Set the python PATH you want to use in that environment with the -p or --python option
workon python2.7
In that environment
When you want to get out of the environment
deactivate
so
brew install python3
mkvirtualenv python3 --python /usr/local/bin/python3
brew install pypy
mkvirtualenv pypy -p /usr/local/bin/pypy
Recommended Posts