Homebrew Python并写入/Library/Python/2.7/site-packages/?

有没有关于如何正确安装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

我有OSX 10.8(Mountain Lion)DP3,我安装了XCode命令行工具.

我也安装了XQuartz,以防万一(10.8不提供).

然后我跑了:

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会安装到它自己的站点包中,而且我不需要在文件系统树上做奇怪的chown来让事情发挥作用?

干杯,
胜利者

请作为一个确切位置的人,首先开始使用虚拟环境,然后使用pip和其他环境.他们很棒,并将解决这个和许多未来的问题.
相关文章
相关标签/搜索