Solution to psycopg2 installation in Windows

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.