Python: Installing pygresql

6.7k views Asked by At

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

There are 2 answers

7
Anthony Forsberg On

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

0
sleepcoffeedelight On

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 :)