无法在Mac OS X 10.9上安装psycopg2 2.5+。

3

这是错误日志:

building 'psycopg2._psycopg' extension

creating build/temp.macosx-10.9-intel-2.7

creating build/temp.macosx-10.9-intel-2.7/psycopg

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090301 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/Library/PostgreSQL/9.3/include -I/Library/PostgreSQL/9.3/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

有什么建议吗?有什么解决方法吗?我已经被这个问题完全卡住了一天。

3个回答

7

这解决了我在OSX 10.9上遇到的问题。谢谢! - Bartek

2

尝试运行:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2


谢谢,这个方法有效,其他答案都失败了! - Peteris

1

我相信pyscopg2目前还不支持9.3。这里是http://initd.org/psycopg/docs/news.html的文档。

我看到了对9.1和9.2的引用,但是特别是因为它只是在几个月前发布的,所以没有关于9.3的任何内容。9.3包含其自己的Foreign Writable包装器,其他模块如Multicorn现在都在使用它。

http://www.postgresql.org/about/news/1481/

我可能说错了,只是一个可能性。尝试使用9.2版本看看是否可以解决。


1
9.3之前有一段时间发布了,我相信。 - Bobo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接