Search code examples
python-3.xpostgresqlpgdb

pgdb import error (_pd.pyd file not created)


Facing the same issue as ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found, but in this case I can see that _pg.pyd file is not created in the site packages of the virtual environment.

import pg
  File "c:\users\pmlp\.virtualenvs\qc-scheduling-nfxvviij\lib\site-packages\pgdb.py", line 68, in <module>
from _pg import *
ImportError: DLL load failed: The specified module could not be found.

Any idea how I can create it or why it is not created?


Solution

  • I found out that I just needed to add the postgree path to the user path:

    set PATH=C:\Program Files\PostgreSQL\10\bin;%PATH%