原始消息(现已过时):
运行python setup.py install之后,我得到以下信息:
After running python setup.py install I get the following:
Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 - DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o unable to execute gcc-4.0: No such file or directory error: command 'gcc-4.0' failed with exit status 1对于知道第一个问题的人来说,那里似乎有些尖叫关于后端Web编程的事情,但不幸的是,这全都是我的事。 psycopg2文档没有帮助。
There's probably something screamingly obvious there to anyone who knows the first thing about back-end web programming, but unfortunately it's all gobbledegook to me. The psycopg2 documentation was not helpful.
6月12日初更新:更新了我所有的软件之后,错误消息已更改。
UPDATE early 12 June: After updating all my software, the error message has changed.
现在,当我运行 python setup.py install时,我得到以下信息:
Now, when I run "python setup.py install" I get the following:
Warning: Unable to find 'pg_config' filebuilding 'psycopg2._psycopg' extension gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.1 (dt dec ext pq3)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I. -c psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/psycopgmodule.o之后是很长的其他错误消息列表。
followed by a very long list of other error messages.
当我在终端中输入 gcc-4.0时,可能会或可能无关紧要。它会返回:
It may or may not be relevant that when I put "gcc-4.0" into Terminal, it comes back with:
i686-apple-darwin10-gcc-4.0.1: no input files
UPDATE 12:41 GMT 12月12日: I认为macports安装已经成功,但是当我尝试运行站点时,它以以下错误结束:
UPDATE 12:41 GMT 12 June: I thought the macports installation had worked, but when I tried running a site it ended with the following error:
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2$的模块b $ b
所以我想这意味着psycopg2毕竟没有正确安装。因此,我回到正题。
So I guess that means that psycopg2 hadn't installed properly after all. So I'm back to square one.
推荐答案我认为您正在变得比原本要难。与其直接运行setup.py,不建议让MacPorts为您做这件事:
I think you're making it harder than it has to be. Rather than running setup.py directly, I suggest letting MacPorts do it for you:
sudo port install py26-psycopg2
更多推荐
为什么我不能安装psycopg2? (Python 2.6.4,PostgreSQL 8.4,OS X 10.6.3)
发布评论