Nampa Gwakondo
Nampa Gwakondo

Reputation: 95

How to import psycopg2 when installed - Windows

Can somebody please help me install this psycopg2 which I dont even know what it is. I have no python knowledge, I need this to run a code to connect to read data from txt to postgres.

Problem is, I have installed psycopg2 from exe and but when I run import psycopg2 in python shell I get an error:

import psycopg2

Traceback (most recent call last): File "", line 1, in import psycopg2 ImportError: No module named psycopg2

Upvotes: 0

Views: 1394

Answers (2)

Abhinav Macha
Abhinav Macha

Reputation: 58

the pip install in windows doesn't seem to work well and ends up with the error you have mentioned. You can try the binaries provided in StickPeople website. These binaries install without problem and will allow you to access psycopg2. Please check the version of python you have installed with the version of the psycopg2 version. If they don't match up, it'll result in such errors. Even the architecture x86 or x64 matters.
C:\> easy_install psycopg2-2.6.1.win32-py2.7-pg9.4.4-release.exe,
you can try this if the binary fails.

Upvotes: 0

RAM BABU
RAM BABU

Reputation: 17

i think Psycopg2 is not installed. please install psycopg2 using pip like: pip install psycopg2 once done with this you can import

Upvotes: 0

Related Questions