有没有一份权威的指南,教我们如何正确地安装Homebrew的Python,以及pip、virtualenv、virtualenvwrapper等工具?
我已经阅读了以下页面:
https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python
http://osxastrotricks.wordpress.com/2012/05/02/python-setup-with-homebrew/
http://skipperkongen.dk/2011/11/13/installing-django-in-virtual-environment-on-mac/
http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/
http://youshoulddoityourself.blogspot.com.au/2010/11/test.html
brew install python --universal --framework
我将以下内容添加到了我的
~/.bash_profile
中:export PATH="/usr/local/bin:/usr/local/share/python:${PATH}"
我随后运行了:
sudo easy_install pip
这似乎是有效的。
我检查了pip的安装位置:
Victors-MacBook-Pro:~ victorhooi$ which pip
/usr/local/bin/pip
然而,当我尝试使用pip安装软件包时,出现了一个错误,指出无法写入到/Library/Python/2.7/site-packages:
running install_lib
creating /Library/Python/2.7/site-packages/yolk
error: could not create '/Library/Python/2.7/site-packages/yolk': Permission denied
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/Users/victorhooi/build/yolk/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/gg/m37t1rkx4zj7z54ls487jfc40000gn/T/pip-ap7LSB-record/install-record.txt failed with error code 1 in /Users/victorhooi/build/yolk
Storing complete log in /Users/victorhooi/Library/Logs/pip.log
我的理解是,Homebrew的Python会安装到它自己的site-packages中,我不需要在整个文件系统树上进行奇怪的chown操作才能使它正常工作?
谢谢, 维克多