OpenBSD、PostgreSQL9.2、python2.7 尝试从 python 命令行导入 psycopg2 模块:
Python 2.7.3 (default, Aug 3 2012, 05:33:56)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 67, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: Cannot load specified object
psycopg2 已编译并安装。我在 /site-packages/psycopg2 文件夹中看到了 _psycopg.so。也许他看不到这个图书馆?