views:

166

answers:

0

I have a question similar to http://stackoverflow.com/questions/1306367/python-importerror-dll-load-failed-when-trying-to-import-psycopg2-library

I'm trying to run psycopg2 with Python 2.6.5, built with Visual Studio 2008 (vc9). I get this error:

from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID

ImportError: DLL load failed: The operating system cannot run %1.

libpg.dll, from PostGres 8.4, is in the path. If I build psycopg2 with a vc6-built python, it will run fine. But the problem is that I need it to work with a vc9-built Python.

The page I referenced mentioned using an older version. When I try building version 2.12.0 (or even 2.10.0), I get this error:

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -DPSYCOPG_DEFAULT_PYDATETIME=1 "-DPSYCOPG_VERSION=\"2.0.10 (dt d ec ext pq3)\"" -DPG_VERSION_HEX=0x080401 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BO OLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -IC:\Python26\include -IC:\Pytho n26\PC -I. -Ic:/apps/POSTGR~1/8.4/include -Ic:/apps/POSTGR~1/8.4/include/server /Tcpsycopg\connection_int.c /Fobuild\temp.win32-2.6\Release\psycopg\connection_i nt.obj /Wp64 cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release connection_int.c psycopg\connection_int.c(70) : error C2143: syntax error : missing ';' before 't ype' psycopg\connection_int.c(71) : error C2065: 'notice' : undeclared identifier psycopg\connection_int.c(71) : warning C4047: '=' : 'int' differs in levels of i ndirection from 'connectionObject_notice *' psycopg\connection_int.c(73) : error C2065: 'notice' : undeclared identifier psycopg\connection_int.c(73) : warning C4047: '!=' : 'int' differs in levels of indirection from 'void *'

and on and on.... Looking at the C code, there is no conditional code wrapping the definition of struct connectionObject_notice, so I don't see what would trigger this error.

Finally, a poster in the above thread mentioned "PG6000". What is that?

  • Eric