导入错误:DLL加载失败: - 试图导入psycopg2库时(ImportError: DLL lo

2019-07-02 13:35发布

>>> 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包,但我仍然得到同样的错误。

Answer 1:

根据这一线索 ,你需要安装一个早期版本,因为有与最新版本的问题。

只需安装一个早期版本(2.0.10伟大工程),甚至在PostgreSQL 8.4.x系列。



Answer 2:

在Windows中,请确保您的路径包括Postgres的bin目录。 在我的机器上是C:\程序\的PostgreSQL \ 9.3 \ bin中。



Answer 3:

您也可以尝试从安装双赢psycopg 这里



文章来源: ImportError: DLL load failed : - when trying to import psycopg2 library