2009-08-20 128 views
13
 
>>> 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包,但我仍然得到相同的錯誤。導入錯誤:DLL加載失敗: - 試圖導入psycopg2庫

回答

11

根據這thread您需要安裝較早的版本,因爲最新版本存在問題。

Simply install an earlier version, (2.0.10 works great), even with PostgreSQL 8.4.x series.

+0

謝謝!這解決了它。 – john2x 2009-08-21 00:14:25

+0

libpq未與psycopg2軟件包保持同步。 PG6000是解決方案! – iElectric 2009-08-21 10:03:20

7

您也可以嘗試從here

14

安裝雙贏psycopg在Windows中,請確保您的路徑包括Postgres的bin目錄。在我的機器中是c:\ Programs \ PostgreSQL \ 9.3 \ bin。

+1

+1看起來您*需要*在路徑中需要PostgreSQL二進制文件 – danodonovan 2014-01-02 15:32:10

+0

在主站點(http://www.postgresql.org/)的窗口上安裝PostgreSQL後添加此路徑條目解決了我的問題。 – DavidJ 2014-07-16 16:18:00

+2

這是2015年的正確答案 – philshem 2015-01-19 15:13:20

相關問題