psycopg / psycopg2

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

Error installing on Kali linux WSL #1706

Closed abhijit-23blaze closed 4 months ago

abhijit-23blaze commented 4 months ago

this is the error : psycopg/psycopgmodule.c: In function ‘add_module_types’: psycopg/psycopgmodule.c:920:36: error: lvalue required as left operand of assignment 920 | Py_TYPE(typetable[i].type) = &PyType_Type; | ^ psycopg/psycopgmodule.c: In function ‘datetime_init’: psycopg/psycopgmodule.c:952:30: error: lvalue required as left operand of assignment 952 | Py_TYPE(&pydatetimeType) = &PyType_Type; | ^ psycopg/psycopgmodule.c: In function ‘PyInit__psycopg’: psycopg/psycopgmodule.c:1084:28: error: lvalue required as left operand of assignment 1084 | Py_TYPE(&typecastType) = &PyType_Type; | ^ psycopg/psycopgmodule.c:1087:25: error: lvalue required as left operand of assignment 1087 | Py_TYPE(&chunkType) = &PyType_Type; | ^ psycopg/psycopgmodule.c:1090:25: error: lvalue required as left operand of assignment 1090 | Py_TYPE(&errorType) = &PyType_Type; | ^ error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for psycopg2 Running setup.py clean for psycopg2 Failed to build psycopg2 ERROR: Could not build wheels for psycopg2

What do you think is the error ?

abhijit-23blaze commented 4 months ago

I probably think that this is some versioning error so please lead me to a correct version 🙏

dvarrazzo commented 4 months ago

You are using a compiler that is not supported, as far as I can see.

If you are on windows, you should use binary packages. If you want to compile the module yourself you should be able to do it on your own, because we don't do windows development (for free) apart from what can be built and tested on publicly available infrastructure, and psycopg2 works on github.