2012-02-23 74 views
1

运行自制软件未能安装postgresql;蟒蛇64位错误

$ 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 

时遇到错误这里就是蟒蛇的位置。

$ 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 

虽然我得到蟒蛇64位的错误,我的Python版本是64位,根据该SO post

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

64

回答

0

该命令安装服务器,不python绑定。那是你要的吗?有一个installer for osx将为您安装服务器。

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

+0

[Heroku](http://devcenter.heroku.com/articles/local-postgresql#macintosh)建议使用自制软件将PostgreSQL用于本地Rails开发。我不明白为什么要安装python绑定。 – paniwani 2012-02-28 19:11:24

+0

在安装程序或服务器时,Homebrew默认包含python,ruby和其他语言绑定,而不是将它们作为单独的包提供。所以'postgresql'包包含服务器,客户端和语言绑定。 – 2013-05-01 01:16:16

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

如果您在PostgreSQL中不需要Python绑定,那么您也可以在不使用Python绑定的情况下使用brew install postgresql --no-python来安装它。