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

标签 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 所在的位置。

$ 哪个 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

最佳答案

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

关于python - Homebrew 无法安装 postgresql; python 64位错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9410498/

相关文章:

python - Django 提供过时的表单验证选项

python - 导入错误 : No module named imgaug

OS X 中使用 openmp 的 Python 扩展

python - 将装饰器应用于导入的函数?

swift - 系统默认值?

xcode - 自动布局:高度不可变,尽管 "height >= constraint"

sql - 从 rails 环境中的表中查询不同组中具有最大 id 的所有记录

postgresql - 在 SQL 事务中获取实体的 id 字段

regex - postgres 正则表达式子字符串转义字符

Python 在 cmd 中使用 argparse