简体   繁体   English

在Mac OS 10.6上安装psycopg2时出错

[英]Error installing psycopg2 on Mac OS 10.6

Hi i am trying to install psycopg2 on Mac 10.6. 嗨,我想在Mac 10.6上安装psycopg2。 After i install i get this error when i try to import 我安装后,我尝试导入时出现此错误

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

I got the source from http://initd.org/psycopg/download/ and tried to build from source using setup/easy_install with the value for pg_config set to /Library/PostgreSQL/8.4/bin/pg_config in setup.cfg 我从http://initd.org/psycopg/download/获得了源代码,并尝试使用setup / easy_install从源代码构建,并在setup.cfg中将pg_config的值设置为/Library/PostgreSQL/8.4/bin/pg_config

I tried all these alternatives and nothing seems to work 我尝试了所有这些替代品,但似乎没有任何效果

http://blog.timc3.com/2010/08/20/psycopg2-os-x-_pqbackendpid/ 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/ http://initd.org/psycopg/articles/2010/11/11/links-about-building-psycopg-mac-os-x/

Any ideas whats happening here?? 有什么想法在这里发生?

根据这个链接 ,psycopg2似乎必须在MacOSX上以32位模式工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM