2012-02-23 73 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來安裝它。