0

I am trying to install PyGreSQL module on my computer using pip. It shows this message: Collecting pygresql Using cached PyGreSQL-5.0.3-cp35-cp35m-win_amd64.whl Installing collected packages: pygresql Successfully installed pygresql-5.0.3 But when I try to import it the very next message is this

>>> import pygresql
   Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named 'pygresql'
 >>> from pygresql import _pg
   Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   ImportError: No module named 'pygresql'

2 Answers2

0

its pg as in from pg import DB according to the documentation on their site.

  • `>>> from pg import db Traceback (most recent call last): File "", line 1, in g.py", line 32, in from _pg import * ImportError: DLL load failed: The specified module could not be found. ` – sleepcoffeedelight Jan 02 '17 at 11:53
  • It is case specific: `DB`. – Anthony Forsberg Jan 02 '17 at 12:07
  • Yeah. Tried that too. It isn't working. It says it doesn't recognize the module pygresql – sleepcoffeedelight Jan 02 '17 at 12:21
  • Seems like this could be a duplicate of: http://stackoverflow.com/questions/28628836/ver-2-pygresql-error-from-pg-import-importerror-dll-load-failed-the-specif/28631274#28631274 You likely don't have PostgreSQL itself installed. – Anthony Forsberg Jan 02 '17 at 14:13
  • Yes. I was planning to use this driver to access RedShift database and not PostGreSQL – sleepcoffeedelight Jan 03 '17 at 11:26
  • Its still required or at least some kind of supported database driver is, Amazon has its own RedShift drivers but if you aren't using theirs just grab the PostGreSQL installation package; there is a DLL included that it needs. – Anthony Forsberg Jan 03 '17 at 13:52
  • The installer is here: https://www.postgresql.org/download/windows/ Installation instructions for pygresql: http://www.pygresql.org/contents/install.html – Anthony Forsberg Jan 04 '17 at 16:54
0

I was able to solve this problem after reading this link.

The first error I faced was not having compatible versions of postgresql and python. The second error was not having right path variables set.

Hope this helps someone with the same issue. Thank you guys :)

Community
  • 1
  • 1