psycopg / psycopg2

PostgreSQL database adapter for the Python programming language
https://www.psycopg.org/
Other
3.35k stars 506 forks source link

psycopg2==2.9.9 won't be recognized on Python 3.12.4 (Windows 10) #1709

Closed codingPineAppl3 closed 3 months ago

codingPineAppl3 commented 3 months ago

Please complete the following information:

Describe the bug I get "ModuleNotFoundError: No module named 'psycopg'" even though psycopg2==2.9.9 is installed. I work with venv. But I also tried to install it globally and still got the same error. I also tried to install the binary version as suggested in this StackOverflow page. I am out of ideas. Capture

dvarrazzo commented 3 months ago

You have install psycopg2 but the import error reports psycopg which is Psycopg 3.

codingPineAppl3 commented 3 months ago

You have install psycopg2 but the import error reports psycopg which is Psycopg 3.

It doesn't matter if I install psycopg2 or psycopg. Even If I install both, I still get this error.

dvarrazzo commented 3 months ago

You must be installing them the wrong place. The error says that the module is not found. You are probably using pip from one environment and python from another.