manwithafork
manwithafork

Reputation: 21

Why can't I import pg.py?

>>> import pg

Traceback (most recent call last):
  File "<pyshell#40>", line 1, in <module>
    import pg
  File "C:\EPD\lib\site-packages\pg.py", line 21, in <module>
    from _pg import *
ImportError: DLL load failed: The specified module could not be found.

I downloaded PyGreSQL 4.0 for Windows, and installed it into the \LIB\site-packages of my python directory. When I try to import pg.py, I get this error. :(

Upvotes: 2

Views: 3804

Answers (2)

Andrew
Andrew

Reputation: 13191

Looks like it's unable to find libpq.dll. Make sure that the directory which contains libpq.dll from your PostgreSQL installation is in your Windows path.

Upvotes: 1

Erik B
Erik B

Reputation: 42574

Have you looked in the C:\EPD\lib\site-packages\ directory? Perhaps you did not install to the right site-packages directory?

Upvotes: 0

Related Questions