【问题标题】:Homebrew failing to install postgresql; python 64-bit errorsHomebrew 安装 postgresql 失败; python 64位错误
【发布时间】:2012-02-23 09:43:24
【问题描述】:

我在运行时遇到错误

$ 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 路径

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

【问题讨论】:

    标签: python macos postgresql homebrew


    【解决方案1】:

    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 install,然后放回去。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        【解决方案3】:

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

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

        【讨论】:

        • Heroku 建议使用 homebrew 使用 PostgreSQL 进行本地 Rails 开发。我不明白为什么要安装 python 绑定。
        • Homebrew 在安装程序或服务器时默认包含 python、ruby 和其他语言绑定,而不是作为单独的包提供它们。所以“postgresql”包包括服务器、客户端和语言绑定。
        猜你喜欢
        • 1970-01-01
        • 2016-01-31
        • 2021-07-30
        • 2019-01-05
        • 2021-06-09
        • 2012-11-15
        • 2022-11-03
        • 2012-08-05
        • 1970-01-01
        相关资源
        最近更新 更多