OSX にPythonをeggインストールして使おう
easy_install もいいけど、いい加減pipかなと。
sudo でシステム空間に突っ込むのが一番手っ取り早いとは思うんだけど、システム空間は汚したくないよね。
HOMEディレクトリに作る
mkdir ~/.py/ export PYTHONPATH=~/.py #仮置き場 virtualenv を用意 easy_install --install-dir ~/.py virtualenv mkdir -p ~/.python/virtualenv/ #実際に入れる場所 ~/.py/virtualenv ~/.python/virtualenv/ rm -rf ~/.py echo "export PYTHONPATH=~/.python/virtualenv" >> ~/.bashrc echo "export PATH=~/.python/virtualenv/bin:$PATH" >> ~/.bashrc source ~/.bashrc
やってること
仮置き場に、virtualenvを持ってきて、virutalenvを実行して環境作成。 virtualenv はsudo でシステム空間に入れちゃっても良いかもしれない。
easy_install は osx のシステムに用意されたものを使った。
実際に使ってみよう
pip install virtualenvwrapper
これでちゃんとインストールされたはず
ちゃんとインストールされたか確認
ls -l .python/virtualenv/lib/python2.7/site-packages/virtualenvwrapper*egg*
ちゃんとeggインストールされてる
参考資料
http://reiare.net/blog/2012/04/19/virtualenv/
https://docs.python.org/2/install/index.html#alternate-installation-the-user-scheme
userbase や home やなどインスト先を指定するという発想
http://virtualenvwrapper.readthedocs.org/en/latest/install.html