Python 找不到平台相关库——Mac Homebrew 安装

Python 找不到平台相关库——Mac Homebrew 安装

为了净化我的环境,我最近从我的 Mac OS 10.6.6 盒子中删除了 MacPorts 以及其中的所有痕迹,并用新潮的 Homebrew 取而代之(https://github.com/mxcl/homebrew)。

今天我遇到了第一个问题。我试图安装 Python 2.7.1(Mac OS X 仍然默认为 2.6)。我brew install python在终端上运行。一切似乎都安装得很好。python然而,当我运行时,我收到了以下输出:

pygmalion:~:% python
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 2.7.1 (r271:86832, Jan 24 2011, 12:12:00) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

起初我以为这只是一个无关紧要的错误信息,但经过进一步调查,我发现 Python 非常缺少其核心系统库。我尝试过卸载/重新安装,尝试过各种不同的值,$PYTHONHOME$PYTHONPATH到目前为止都没有成功。

就系统信息而言:brew似乎已经在 中安装了 Python /usr/local/bin/python

pygmalion:~:% brew --config
HOMEBREW_VERSION: 0.7.1
HEAD: 38b93387ea732d6c6b08a491f74124854b28107a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.6.6
Kernel Architecture: i386
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 3.2.5
GCC-4.0: build 5494 
GCC-4.2: build 5664 
LLVM: build 2333 
MacPorts or Fink? false
X11 installed? true

提前谢谢...我不知所措。

编辑:这是 的输出sys.path

Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 2.7.1 (r271:86832, Jan 24 2011, 12:12:00) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/local/Cellar/python/2.7.1/lib/python27.zip',    '/usr/local/Cellar/python/2.7.1/lib/python2.7', '/usr/local/Cellar/python/2.7.1/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.1/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.1/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.1/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.1/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.1/lib/lib-dynload', '/Users/dlobraico/.local/lib/python2.7/site-packages', '/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages',        '/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages']
>>> 

相关内容