when installing psycopg2 in my Django project
pip install psycopg2==2.7.*
I get this error :
psycopg/psycopgmodule.c:689:18: error: incomplete definition of type 'struct _is'
I tried the answer to the following question: Is there any problem installing psycopg2 in virtualenv on MacOS catalina with PostgreSQL 12.1 installed? but I still get the same error
The current psycopg2 implementation supports: Python 2 versions from 2.6 to 2.7. Python 3 versions from 3.2 to 3.6. PostgreSQL server versions from 7.4 to 9.6.
The psycopg2 package is the current mature implementation of the adapter: it is a C extension and as such it is only compatible with CPython.
To check which version of psycopg2-binary is installed, use pip show psycopg2-binary or pip3 show psycopg2-binary in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu) to obtain the output major.
Installing psycopg2-binary
worked for me.
If you are using Python 3.8.x then the support for the same was added in psycopg2 2.8.x. I faced the same problem but worked out fine once I switched to python 3.7.x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With