Use in Windows
Easy_installpsycopg2 is successfully installed when psycopg2 is installed, but the following error is prompted when psycopg2 is imported in Python:
From psycopg2. _ psycopg import binary, number, String, datetime, rowid
Importerror: DLL load failed: the specified module cannot be found.
Why ??
Importerror: DLL load failed: the specified module cocould not be found. the file _ psycopg. PYD is a DLL. for its relatively small size it isprobably dynamically linked to the libpq. DLL. I think the systemeither fails to find libpq. DLL or some of the other Dependencies (theyare listed in the setup. PY ).
I suggest you to use a tool to check its DLL dependencies (maybehttp: // www.dependencywalker.com/cocould be OK) and see if there isanything missing. if libpq. DLL is the missing one, try putting it in apath directory or in the psycopg2 package directory.
The specific solution is as follows:
Find libpq. dll, copy it to the package of psycopg2, or place it under the system path.