在OS X Yosemite上安装psycopg2时出现编译器错误

时间:2014-12-18 04:27:35

标签: gcc psycopg2

命令行工具是最新的,满足所有其他要求。我怀疑这是某种编译器冲突,但我不确定。我没有使用virtualenv。

pip install psycopg2

产量

gcc: error: x86_64: No such file or directory

gcc: error: unrecognized option '-arch'

error: command 'gcc' failed with exit status 1

命令是:

gcc -fno-strict-aliasing -I/Users/username/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.4 (dt dec pq3 ext)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DPG_VERSION_HEX=0x090305 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/Users/username/anaconda/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.5_1/include -I/usr/local/Cellar/postgresql/9.3.5_1/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.5-x86_64-2.7/psycopg/psycopgmodule.o

补充工具栏:我不确定为什么要尝试调用anaconda,我曾经安装过Julia。

1 个答案:

答案 0 :(得分:1)

通过删除anaconda的根目录(使用conda info命令)解决了这个问题。我还不清楚为什么Anaconda会产生这些问题(欢迎提供相关信息!),但无论如何问题都已得到解决。