I get the following error when trying to compile:
psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:689:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
while (interp->next)
This occurs for the 'master' branch from github as well. I believe the correct fix is to use PEP 3121 (Extension Module Initialization and Finalization) APIs so that psycopg can have per-interpreter state. Within that state, it can keep a cache to the decimal type object.
I believe the correct fix is to use PEP 3121
Right, it would be nice. But it can require a lot of work.
Just to fix the compilation error, psyco_is_main_inter() can be modified to use the new PyInterpreterState_Main() function introduced in Python 3.7.
@nascheme @vstinner PyInterpreterState_Main is not documented, and bears the disclaimer in the source code:
/* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */
Maybe you could provide a patch to suggest the correct usage?
Thank you
Hi, I try to build, apache superset, where one of the deps is psycopg2-binary==2.7.5
I do have the devel packages, and everything. But I still am getting the error:
psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:689:18: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
689 | while (interp->next)
| ^~
psycopg/psycopgmodule.c:690:24: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
690 | interp = interp->next;
| ^~
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/gaurav/Projects/incubator-superset/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rmveb1xw/psycopg2-binary/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rmveb1xw/psycopg2-binary/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-qck0nq6q/install-record.txt --single-version-externally-managed --compile --install-headers /home/gaurav/Projects/incubator-superset/env/include/site/python3.8/psycopg2-binary Check the logs for full command output.
Support to Python 3.8 was added in psycopg 2.8.4
Any can help me please?
Best match: psycopg2-binary 2.7.4
Processing psycopg2-binary-2.7.4.tar.gz
Writing /tmp/easy_install-_ttdt6d_/psycopg2-binary-2.7.4/setup.cfg
Running psycopg2-binary-2.7.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_ttdt6d_/psycopg2-binary-2.7.4/egg-dist-tmp-l99_u3nq
psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
685 | while (interp->next)
| ^~
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
http://initd.org/psycopg/docs/install.html).
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
@optimostech what part of "Support to Python 3.8 was added in psycopg 2.8.4" is not clear to you?
@optimostech what part of "Support to Python 3.8 was added in psycopg 2.8.4" is not clear to you?
This is really rude.
@tomasz-szymanek So are requests demanding help which don't care for the work already used to answer them.
Most helpful comment
@optimostech what part of "Support to Python 3.8 was added in psycopg 2.8.4" is not clear to you?