在Mac OS 10.6上安装psycopg2时出错

时间:2011-12-06 19:59:09

标签: python postgresql osx-snow-leopard psycopg2

您好我正在尝试在Mac 10.6上安装psycopg2。我安装后,当我尝试导入

时出现此错误
import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/psycopg2/__init__.py", line 69, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.6/site-packages/psycopg2/_psycopg.so, 2): Symbol  not found: _PQbackendPID
Referenced from: /Library/Python/2.6/site-packages/psycopg2/_psycopg.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/psycopg2/_psycopg.so

我从http://initd.org/psycopg/download/获得了源代码,并尝试使用setup / easy_install从源代码构建,并在安装程序中将pg_config的值设置为 /Library/PostgreSQL/8.4/bin/pg_config 。 CFG

我尝试了所有这些替代方案,似乎没有任何工作

http://blog.timc3.com/2010/08/20/psycopg2-os-x-_pqbackendpid/

http://initd.org/psycopg/articles/2010/11/11/links-about-building-psycopg-mac-os-x/

这里有什么想法吗?

1 个答案:

答案 0 :(得分:0)

根据this link,psycopg2似乎必须在MacOSX上以32位模式工作