Python 3.8-dev, xenial -- unable to pip install psycopg2-binary

About a week ago, I noticed that my build that uses Python 3.8-dev was erroring out when attempting to “pip install psycopg2-binary”. Here is a link to the relevant build:

Here is the error:

  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)
  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
  error: command 'gcc' failed with exit status 1
  Failed building wheel for psycopg2-binary

In the past this installation had been succeeding. Here is a link to a successful build:

I cannot tell what has changed on the travis side that would prevent this from building, but perhaps some headers are missing?

If it was passing in the past, a likely explanation is that recent development in the 3.8 branch is causing issues. I suggest reporting issues upstream (probably psycopg). I don’t think this is a Travis CI issue.

I do not think it is a psycopg2 issue because, as you can see in the passing and failing builds, the exact same version of psycopg2 is being installed (2.7.7), with the same checksum.

I believe this is either a travis issue, or an issue in the way travis packages/installs Python 3.8.

As I said, 3.8-dev branch is in active development, and there appears to be a discrepancy between it and the module you are trying to use. The code that used to work no longer does. Please report it upstream, so that the developer can adapt to the upcoming 3.8 changes.

I’m not sure I understand. The “3.8-dev” is a TravisCI built-in/pre-configured Python setting. To whom am I supposed to report this, if not to you?

3.8-dev is a binary compiled from Python’s tip-of-development code that is refreshed daily. This is for brave souls like you and module developers so that they can understand what is coming down the pipeline and make changes to be 3.8-ready when it is released. If this is not your use case, I strongly suggest not using 3.8-dev.

I’ve answered this question in the first reply.

Thanks for the info about the 3.8-dev environment. I wonder if something may have changed in the way it is built or installed?

No. See the code here:

The change that affects your builds is in the CPython code. And it is not accounted for by psycopg2. The module developer needs to resolve the problem.