Help us understand the problem. What is going on with this article?

virtualenvでpython

More than 5 years have passed since last update.
pip install virtualenv virtualenvwrapper

.bashrcもしくは.zshrcとかに

source /usr/local/bin/virtualenvwrapper.sh

仮想開発環境を作りたいとき

mkvirtualenv python2.7 -p /usr/local/bin/python

-pもしくは--pythonオプションで、その環境で使いたいpythonのPATHを設定

workon python2.7

でその環境に

環境から出たいときは

deactivate

(備考)ついでにpython3とpypyも
brew install python3
mkvirtualenv python3 --python /usr/local/bin/python3
brew install pypy
mkvirtualenv pypy -p /usr/local/bin/pypy
fukkyy
Gunosyの中の人
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away