0

尝试安装 psycopg2 时出现以下错误

构建“psycopg2._psycopg”扩展

clang -fno-strict-aliasing -fno-common -dynamic -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 -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX= 0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I。-I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.8-intel-2.7/psycopg/psycopgmodule.o

无法执行clang:没有这样的文件或目录

错误:命令“clang”失败,退出状态为 1

我该如何解决?

4

2 回答 2

2

从错误消息中,您缺少用于编译 psycopg2 的 clang 包。

从问题的标签中,我认为您在 osx 上,也许以下链接将帮助您获取和安装它: http ://woss.name/2012/01/24/how-to-install-a-working -set-of-compilers-on-mac-os-x-10-7-lion/

于 2012-12-09T02:43:30.887 回答
1

要获得 clang,首先安装 Xcode,然后从 Xcode 中安装命令行工具。

这是关于它的stackoverflow帖子

于 2012-12-09T03:15:51.530 回答