无法使用XCode4在OSX 10.6.7上安装psycopg2 [英] Cannot install psycopg2 on OSX 10.6.7 with XCode4

查看:71
本文介绍了无法使用XCode4在OSX 10.6.7上安装psycopg2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在OSX上安装psycopg2会导致以下结果:

Trying to install psycopg2 on OSX results in the following:

building 'psycopg2._psycopg' extension

creating build/temp.macosx-10.6-universal-2.6

creating build/temp.macosx-10.6-universal-2.6/psycopg

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090003 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -I/usr/local/Cellar/postgresql/9.0.3/include -I/usr/local/Cellar/postgresql/9.0.3/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.6-universal-2.6/psycopg/psycopgmodule.o

/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed

Installed assemblers are:

/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64

/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

psycopg/psycopgmodule.c:1009: fatal error: error writing to -: Broken pipe

compilation terminated.

lipo: can't open input file: /var/folders/zf/zfsYTD29GwSWm+UDcF6VxE+++TM/-Tmp-//ccd8ckcV.out (No such file or directory)

error: command 'gcc-4.2' failed with exit status 1

有人知道如何安装吗? 我已经安装了Postgres,它似乎可以正常工作.

Does anyone have any idea what can I do to get it installed? I have Postgres installed and it seems to work fine.

我尝试了easy_install和pip安装,但最终都收到了类似的消息.

I’ve tried both easy_install and pip install, but both end up with a similar message.

推荐答案

似乎ARCHFLAGS实际粘住了问题,所以最终使用:

It seems that there was something wrong with the ARCHFLAGS actually sticking, so finally using:

sudo env ARCHFLAGS =-arch i386 -arch x86_64" pip install psycopg2

sudo env ARCHFLAGS="-arch i386 -arch x86_64" pip install psycopg2

实际可行.

这篇关于无法使用XCode4在OSX 10.6.7上安装psycopg2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆