Skip to content

psycopg2-binary==2.9.6 incompatible with Python 3.12 docker image #37126

Closed

Description

@bimbolimbo

Bug Description

The apache/superset:6.0.0-py312 Docker image is published, but the optional PostgreSQL dependency in pyproject.toml pins psycopg2-binary==2.9.6, which has no pre-built wheels for Python 3.12.

How to Reproduce

FROM apache/superset:6.0.0-py312
RUN pip install 'psycopg2-binary==2.9.6'

Build fails with:

error: command 'gcc' failed: No such file or directory

Expected Behavior

Optional database extras should be installable on all published Python version images.

Suggested Fix

Update pyproject.toml:

postgres = ["psycopg2-binary>=2.9.9"]  # 2.9.9+ has py312 wheels

Environment

  • Superset version: 6.0.0
  • Python version: 3.12 (official docker image)

Activity

  1. dosubot commented on Jan 14, 2026

    @dosubot

    Hi @bimbolimbo! I'm Dosu and I’m helping the superset team.

    You're correct: the postgres extra in Superset's pyproject.toml is pinned to psycopg2-binary==2.9.6, which does not have pre-built wheels for Python 3.12. This causes pip to attempt a source build, resulting in the gcc error you described in minimal Docker images (source).

    This issue is widely reported by users running Superset on newer Python versions and containerized environments (discussion). The most robust workaround is to install psycopg2-binary>=2.9.9, which provides Python 3.12 wheels and avoids the need for build tools. However, as of now, the official Superset dependencies have not been updated to reflect this, and there is no official fix merged yet (PR reference).

    If you need to proceed before an official update, you can override the dependency in your Dockerfile with:

    RUN pip install 'psycopg2-binary>=2.9.9'
    

    This should resolve the build failure on Python 3.12 images.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

    Chat with Dosu Open in Cursor Join Discord Share on X

  2. rusackas commented on Jan 27, 2026

    @rusackas
    Member

    PR welcome if the suggested fix does indeed fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions