Homebrew无法安装postgresql; python 64位错误

时间:2012-02-23 09:43:25

标签: python macos postgresql homebrew

我在运行时遇到错误

$ brew install postgresql

==> Downloading http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2
File already downloaded in /Users/neil/Library/Caches/Homebrew
Warning: Detected a framework Python that does not have 64-bit support in:
/Library/Frameworks/Python.framework/Versions/Current/Python

e configure script seems to prefer this version of Python over any others,
 you may experience linker problems as described in:
http://osdir.com/ml/pgsql-general/2009-09/msg00160.html

 fix this issue, you may need to either delete the version of Python
own above, or move it out of the way before brewing PostgreSQL.

te that a framework Python in /Library/Frameworks/Python.framework is
e "MacPython" version, and not the system-provided version which is in:
/System/Library/Frameworks/Python.framework
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --datadir=/usr/local/Cellar/postgresql/9.1.2/shar
^C

这是python所在的位置。

$ which python

/usr/local/bin/python


我从

修改了〜/ .zshrc PATH
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

虽然我得到python 64位错误,但根据这个SO post,我的python版本是64位:

$ python -c 'import struct;print( 8 * struct.calcsize("P"))'

64

3 个答案:

答案 0 :(得分:2)

referenced mailing list post中指出的问题是配置步骤不受此处PATH的影响。有一个完整的其他机制用于查找要链接的内容;请参阅Where do I set DYLD_LIBRARY_PATH on Mac OS X快速介绍。您可以尝试brew脚本给出的建议解决方法 - 将 /Library/Frameworks/Python.framework/Versions/Current/Python 重命名为其他内容,使其脱离链接器的搜索路径,重复brew安装,然后把它放回去。

答案 1 :(得分:1)

如果你的PostgreSQL中不需要Python绑定,你也可以使用brew install postgresql --no-python安装它而不使用Python绑定。

答案 2 :(得分:0)

此命令正在安装服务器,而不是python绑定。那是你要的吗?有installer for osx将为您安装服务器。

完成后,您可以安装psycopg2绑定directly from source