dosubot[bot] commented on issue #34185:
URL: https://github.com/apache/superset/issues/34185#issuecomment-3208171533
<!-- Answer -->
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:
```dockerfile
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:
```dockerfile
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.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>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)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34185)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]