ImportError:DLL加载失败: - 尝试导入psycopg2库时

joh*_*n2x 13 python django postgresql psycopg2

>>> import psycopg2
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 60, in 
    from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: DLL load failed: The application has failed to start because its si
de-by-side configuration is incorrect. Please see the application event log for
more detail.

我在尝试导入psycopg2时遇到此错误..我已经搜索了几天,但没有找到解决方案.我已经尝试安装Visual C++ 2008包,但我仍然得到相同的错误.

Car*_*rra 18

在Windows上,确保您的路径包含Postgres bin目录.在我的机器上它是c:\ Programs\PostgreSQL\9.3\bin.

  • +1看起来你*需要你的路径中的PostgreSQL二进制文件 (3认同)

pki*_*kit 11

根据这个线程,您需要安装早期版本,因为最新版本存在问题.

只需安装早期版本(2.0.10效果很好),即使使用PostgreSQL 8.4.x系列也是如此.


小智 7

您也可以尝试从这里安装win-psycopg