this is my Dockerfile below:

FROM apache/superset:v5.0.0

USER root

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app

RUN apt-get update && \ apt-get install -y --no-install-recommends \ python3-pip python3-dev \ git curl wget bash unzip locales \ fonts-wqy-zenhei \ pkg-config gcc libmariadb-dev-compat libmariadb-dev libpq-dev \ net-tools iputils-ping && \ apt-get clean && \ rm -rf /var/lib/apt/lists/ /tmp/ /var/tmp/*

RUN apt-get update && \ wget -q https://chrome-versions.com/google-chrome-stable-113.0.5672.63-1.deb && \ apt-get install -y --no-install-recommends ./google-chrome-stable-113.0.5672.63-1.deb && \ rm -f google-chrome-stable-113.0.5672.63-1.deb

ENV CHROMEDRIVER_VERSION 113.0.5672.63 RUN wget -q https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \ unzip chromedriver_linux64.zip -d /usr/bin && \ chmod 755 /usr/bin/chromedriver && \ rm -f chromedriver_linux64.zip

RUN pip install --upgrade pip && \ pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql

RUN uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql

USER superset


when i using this to docker build and then docker-compose -f docker-compose.yaml up -d, with the answer by dosubot said "The reason /app/.venv/bin/uv isn't found is that in Superset 5.0.0, uv is installed system-wide, not inside the virtual environment. You should just call uv directly, not with a path." but still show: "File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi import psycopg2 ModuleNotFoundError: No module named 'psycopg2'" also gevent with the same error , so how to fix ?

Originally posted by @tickwong in https://github.com/apache/superset/discussions/34109#discussioncomment-13773829

Comment From: giacomochiarella

I have the same issue after upgrade from 4.1.3 to 5.0.0

Comment From: rusackas

@dosu please advise

Comment From: dosubot[bot]

The issue is that Superset runs inside a virtual environment at /app/.venv, so any Python packages you need (like psycopg2-binary and gevent) must be installed into that venv—not system-wide. Installing with pip or uv as root doesn't put them in the right place for Superset to see them at runtime.

To fix this, update your Dockerfile so that after all system dependencies are installed, you install Python packages using the venv's pip or uv, like this:

RUN /app/.venv/bin/uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql

Or, if you want to verify the install during build:

RUN /app/.venv/bin/uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql && \
    /app/.venv/bin/python -c "import psycopg2, gevent"

This ensures the packages are available to Superset at runtime. For maintainability, you can also use a requirements-local.txt file and install with /app/.venv/bin/uv pip install -r requirements-local.txt during build.

System-wide installs won't work because the Superset process only sees packages inside /app/.venv at runtime.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: tickwong

yup, as dousubot said is correct :

To fix this, update your Dockerfile so that after all system dependencies are installed, you install Python packages using the venv's pip or uv, like this:

RUN /app/.venv/bin/uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql

Or, if you want to verify the install during build:

RUN /app/.venv/bin/uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql && \ /app/.venv/bin/python -c "import psycopg2, gevent"

dosubot[bot] @.***> 于2025年8月21日周四 05:42写道:

dosubot[bot] left a comment (apache/superset#34185) https://github.com/apache/superset/issues/34185#issuecomment-3208171533

The issue is that Superset runs inside a virtual environment at /app/.venv, so any Python packages you need (like psycopg2-binary and gevent) must be installed into that venv—not system-wide. Installing with pip or uv as root doesn't put them in the right place for Superset to see them at runtime.

To fix this, update your Dockerfile so that after all system dependencies are installed, you install Python packages using the venv's pip or uv, like this:

RUN /app/.venv/bin/uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql

Or, if you want to verify the install during build:

RUN /app/.venv/bin/uv pip install --no-cache-dir gevent psycopg2-binary redis pydoris pymysql && \ /app/.venv/bin/python -c "import psycopg2, gevent"

This ensures the packages are available to Superset at runtime. For maintainability, you can also use a requirements-local.txt file and install with /app/.venv/bin/uv pip install -r requirements-local.txt during build.

System-wide installs won't work because the Superset process only sees packages inside /app/.venv at runtime.

To reply, just mention @dosu https://go.dosu.dev/dosubot.

How did I do? Good https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=great_response | Irrelevant https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=irrelevant_answer | Incorrect https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=incorrect_sources | Verbose https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=too_verbose | Hallucination https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=hallucination | Report 🐛 https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=bug_report | Other https://app.dosu.dev/response-feedback/0ba68af5-af57-4f66-9422-436019122538?feedback_type=other [image: Chat with Dosu] https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github [image: Join Discord] https://go.dosu.dev/discord-bot [image: Share on X] https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34185

— Reply to this email directly, view it on GitHub https://github.com/apache/superset/issues/34185#issuecomment-3208171533, or unsubscribe https://github.com/notifications/unsubscribe-auth/BUWUU5MY5D7RFCFNRRMUNPT3OTTWHAVCNFSM6AAAAACBUCLHVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMBYGE3TCNJTGM . You are receiving this because you modified the open/close state.Message ID: @.***>