You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "1yuv (via GitHub)" <gi...@apache.org> on 2025/07/09 00:56:42 UTC
[D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
GitHub user 1yuv created a discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
I am trying to upgrade superset using helm from `4.0.2` to `5.0.0`. I have upgraded successfully from `4.0.2` to `4.1.2` and now when I am trying to upgrade to `5.0.0`. I am getting following error on `superset-init-db` pod.
```
Successfully installed authlib-1.6.0 cffi-1.17.1 cryptography-45.0.5 psycopg2-binary-2.9.10 pycparser-2.22
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[notice] A new release of pip is available: 23.0.1 -> 25.1.1
[notice] To update, run: pip install --upgrade pip
Upgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-07-09 00:22:52,179:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
File "/app/.venv/bin/superset", line 10, in <module>
sys.exit(superset())
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
```
As you can see at the first line of the log I've attached, It mentions that psycopg2 was installed successfully.
GitHub link: https://github.com/apache/superset/discussions/34109
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "joaohnogueira (via GitHub)" <gi...@apache.org>.
GitHub user joaohnogueira added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
you resolved my problem, Thank you so much!!!
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14578952
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "juanrondineau (via GitHub)" <gi...@apache.org>.
GitHub user juanrondineau added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
@dosu, could you see my comment?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14619015
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
Yes, dependencies installed via the bootstrapScript do affect the superset-init-db-* pods/jobs. In the official Superset Helm chart, the init job command sources both the bootstrapScript and the initscript, so anything you install in bootstrapScript (like psycopg2-binary or other Python/system packages) will be available to the init-db job when it runs database migrations and setup tasks [reference](https://github.com/apache/superset/blob/master/helm/superset/values.yaml).
You can verify this in your Helm values.yaml under `init.command`, which by default looks like:
```yaml
command:
- "/bin/sh"
- "-c"
- ". {{ .Values.configMountPath }}/superset_bootstrap.sh; . {{ .Values.configMountPath }}/superset_init.sh"
```
So, as long as you add your dependency installation to bootstrapScript, both the main Superset pods and the init-db jobs will have access to those dependencies [reference](https://github.com/apache/superset/discussions/31500).
Let me know if you need help with custom setups or troubleshooting!
<!-- 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/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e49b18fc-903f-4a88-b19b-75b84664bbca?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](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/discussions/34109)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618307
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
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. So your bootstrapScript should look like:
```yaml
bootstrapScript: |
#!/bin/bash
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
echo "installing required libs"
uv pip install psycopg2-binary authlib
if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
```
This change happened after 4.1.x—Superset 5.0.0 and above use `uv` instead of `pip` for Python package management, and `uv` is available on the system path, not in `.venv` [citation](https://github.com/apache/superset/issues/32364) [citation](https://github.com/apache/superset/pull/33872). That's why `pip` worked for you in 4.1.2, but not in 5.0.0.
Let me know if you still see issues after this change!
<!-- 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/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/165f0416-3c9a-4543-8bf8-dbccaf9a1915?feedback_type=other)</sup> [](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/discussions/34109)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702478
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "1yuv (via GitHub)" <gi...@apache.org>.
GitHub user 1yuv added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
Hi @Pavanpatil0744 , versions in helm chart are versioned differently. Helm 0.14.2 can install superset 5.0.0 if you reference that in your image tag in your values.yml.
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13935064
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "juanrondineau (via GitHub)" <gi...@apache.org>.
GitHub user juanrondineau deleted a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
@dosu, I'm trying to deploy a superset 5.0.0 local environment on minikube from the superset-helm-chart-0.15.1 and I'm still having the "ModuleNotFoundError: No module named 'psycopg2'"
this is my Chart.yml
```apiVersion: v2
appVersion: "5.0.0"
description: Apache Superset is a modern, enterprise-ready business intelligence web application
name: superset
icon: https://artifacthub.io/image/68c1d717-0e97-491f-b046-754e46f46922@2x
home: https://superset.apache.org/
keywords:
- business intelligence
- data science
sources:
- https://github.com/apache/superset
maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.15.1 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
dependencies:
- name: postgresql
version: 13.4.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: redis
version: 17.9.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled```
and this is my bootstrapScript after apply the changes you suggested
```bootstrapScript: |
#!/bin/bash
# Install system-level dependencies
apt-get update && apt-get install -y \
python3-dev \
default-libmysqlclient-dev \
build-essential \
pkg-config
# Install required Python packages
uv pip install \
psycopg2-binary==2.9.1 \
"sqlalchemy>=1.0.0, <2.0.0" \
# Create bootstrap file if it doesn't exist
if [ ! -f ~/bootstrap ]; then
echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap;
fi```
this is the full error
```+ echo Upgrading DB schema...
+ superset db upgrade
Upgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-10-07 18:23:44,940:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
File "/app/.venv/bin/superset", line 10, in <module>
sys.exit(superset())
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'```
can you help me @dosu?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618458
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
Yes, dependencies installed via the bootstrapScript do affect the superset-init-db-* pods/jobs. In the official Superset Helm chart, the init job command sources both the bootstrapScript and the initscript, so anything you install in bootstrapScript (like psycopg2-binary or other Python/system packages) will be available to the init-db job when it runs database migrations and setup tasks [reference](https://github.com/apache/superset/blob/master/helm/superset/values.yaml).
You can verify this in your Helm values.yaml under `init.command`, which by default looks like:
```yaml
command:
- "/bin/sh"
- "-c"
- ". {{ .Values.configMountPath }}/superset_bootstrap.sh; . {{ .Values.configMountPath }}/superset_init.sh"
```
So, as long as you add your dependency installation to bootstrapScript, both the main Superset pods and the init-db jobs will have access to those dependencies [reference](https://github.com/apache/superset/discussions/31500).
Let me know if you need help with custom setups or troubleshooting!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=e49b18fc-903f-4a88-b19b-75b84664bbca) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618307
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "tickwong (via GitHub)" <gi...@apache.org>.
GitHub user tickwong added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
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 ?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13773829
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
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. So your bootstrapScript should look like:
```yaml
bootstrapScript: |
#!/bin/bash
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
echo "installing required libs"
uv pip install psycopg2-binary authlib
if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
```
This change happened after 4.1.x—Superset 5.0.0 and above use `uv` instead of `pip` for Python package management, and `uv` is available on the system path, not in `.venv` [citation](https://github.com/apache/superset/issues/32364) [citation](https://github.com/apache/superset/pull/33872). That's why `pip` worked for you in 4.1.2, but not in 5.0.0.
Let me know if you still see issues after this change!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=165f0416-3c9a-4543-8bf8-dbccaf9a1915) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702478
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
You're welcome! Happy to help—just let me know if you have any more questions.
<!-- 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/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4cc45afe-72bf-4b51-9ac1-e012e919b369?feedback_type=other)</sup> [](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/discussions/34109)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702650
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "juanrondineau (via GitHub)" <gi...@apache.org>.
GitHub user juanrondineau added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
I need help @dosu...
I'm trying to deploy locally superset 5.0.0 from superset-helm-chart-0.15.1. I'm using minikube locally to simulate the eks production environment.
This is my Chart.yaml content
```
apiVersion: v2
appVersion: "5.0.0"
description: Apache Superset is a modern, enterprise-ready business intelligence web application
name: superset
icon: https://artifacthub.io/image/68c1d717-0e97-491f-b046-754e46f46922@2x
home: https://superset.apache.org/
keywords:
- business intelligence
- data science
sources:
- https://github.com/apache/superset
maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.15.1 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
dependencies:
- name: postgresql
version: 13.4.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: redis
version: 17.9.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled
```
and following your advise this is my bootstrapScript
```
# -- Install additional packages and do any other bootstrap configuration in this script
# For production clusters it's recommended to build own image with this step done in CI
# @default -- see `values.yaml`
bootstrapScript: |
#!/bin/bash
# Install system-level dependencies
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
# Install required Python packages
uv pip install psycopg2-binary==2.9.1
# Create bootstrap file if it doesn't exist
if [ ! -f ~/bootstrap ]; then
echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap;
fi
```
buy i'm still having a `ModuleNotFoundError: No module named 'psycopg2'`
Here the log from one of the pods that tries to run de init-job
```
Upgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-10-07 18:23:44,940:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
File "/app/.venv/bin/superset", line 10, in <module>
sys.exit(superset())
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
```
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618765
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
This error happens because Superset 5.0.0 Docker/Helm images are now "lean" and do not include database drivers like psycopg2-binary by default. Also, Superset v5 switched from pip to uv as the Python package manager, so installing with pip may not actually install the driver in the environment Superset uses [ref](https://github.com/apache/superset/issues/32364) [ref](https://github.com/apache/superset/pull/33872).
To fix this, update your Helm chart's bootstrapScript to install psycopg2-binary using uv inside the Superset virtual environment. For example:
```yaml
bootstrapScript: |
#!/bin/bash
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
/app/.venv/bin/uv pip install psycopg2-binary
```
This ensures psycopg2 is available where Superset expects it. You can verify the install by running `/app/.venv/bin/python -c "import psycopg2"` in the pod.
These steps are required for all production/lean images starting from Superset 4.1.x and above, not just 5.0.0 [ref](https://github.com/apache/superset/issues/32186) [ref](https://github.com/apache/superset/discussions/31431).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702356
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "Pavanpatil0744 (via GitHub)" <gi...@apache.org>.
GitHub user Pavanpatil0744 added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
@1yuv
I noticed you mentioned upgrading to Superset 5.0.0 using Helm, but I don’t see version 5.0.0 available in the official Superset Helm
Could you please clarify which Helm repository or chart you are using for Superset 5.0.0?
Is it a custom chart, or are you using a different Helm repo?
Thanks in advance for your help!
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13931328
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
This error happens because Superset 5.0.0 Docker/Helm images are now "lean" and do not include database drivers like psycopg2-binary by default. Also, Superset v5 switched from pip to uv as the Python package manager, so installing with pip may not actually install the driver in the environment Superset uses [ref](https://github.com/apache/superset/issues/32364) [ref](https://github.com/apache/superset/pull/33872).
To fix this, update your Helm chart's bootstrapScript to install psycopg2-binary using uv inside the Superset virtual environment. For example:
```yaml
bootstrapScript: |
#!/bin/bash
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
/app/.venv/bin/uv pip install psycopg2-binary
```
This ensures psycopg2 is available where Superset expects it. You can verify the install by running `/app/.venv/bin/python -c "import psycopg2"` in the pod.
These steps are required for all production/lean images starting from Superset 4.1.x and above, not just 5.0.0 [ref](https://github.com/apache/superset/issues/32186) [ref](https://github.com/apache/superset/discussions/31431).
<!-- 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/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8a8a29a2-bf18-428c-a5ff-e3bd9c1a8695?feedback_type=other)</sup> [](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/discussions/34109)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702356
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "juanrondineau (via GitHub)" <gi...@apache.org>.
GitHub user juanrondineau added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
@dosu, I'm trying to deploy a superset 5.0.0 local environment on minikube from the superset-helm-chart-0.15.1 and I'm still having the "ModuleNotFoundError: No module named 'psycopg2'"
this is my Chart.yml
`apiVersion: v2
appVersion: "5.0.0"
description: Apache Superset is a modern, enterprise-ready business intelligence web application
name: superset
icon: https://artifacthub.io/image/68c1d717-0e97-491f-b046-754e46f46922@2x
home: https://superset.apache.org/
keywords:
- business intelligence
- data science
sources:
- https://github.com/apache/superset
maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.15.1 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
dependencies:
- name: postgresql
version: 13.4.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: redis
version: 17.9.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled`
and this is my bootstrapScript after apply the changes you suggested
`bootstrapScript: |
#!/bin/bash
# Install system-level dependencies
apt-get update && apt-get install -y \
python3-dev \
default-libmysqlclient-dev \
build-essential \
pkg-config
# Install required Python packages
uv pip install \
psycopg2-binary==2.9.1 \
"sqlalchemy>=1.0.0, <2.0.0" \
# Create bootstrap file if it doesn't exist
if [ ! -f ~/bootstrap ]; then
echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap;
fi`
this is the full error
`+ echo Upgrading DB schema...
+ superset db upgrade
Upgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-10-07 18:23:44,940:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
File "/app/.venv/bin/superset", line 10, in <module>
sys.exit(superset())
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'`
can you help me @dosu?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618458
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "juanrondineau (via GitHub)" <gi...@apache.org>.
GitHub user juanrondineau edited a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
@dosu, I'm trying to deploy a superset 5.0.0 local environment on minikube from the superset-helm-chart-0.15.1 and I'm still having the "ModuleNotFoundError: No module named 'psycopg2'"
this is my Chart.yml
```apiVersion: v2
appVersion: "5.0.0"
description: Apache Superset is a modern, enterprise-ready business intelligence web application
name: superset
icon: https://artifacthub.io/image/68c1d717-0e97-491f-b046-754e46f46922@2x
home: https://superset.apache.org/
keywords:
- business intelligence
- data science
sources:
- https://github.com/apache/superset
maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.15.1 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
dependencies:
- name: postgresql
version: 13.4.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: redis
version: 17.9.4
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled```
and this is my bootstrapScript after apply the changes you suggested
```bootstrapScript: |
#!/bin/bash
# Install system-level dependencies
apt-get update && apt-get install -y \
python3-dev \
default-libmysqlclient-dev \
build-essential \
pkg-config
# Install required Python packages
uv pip install \
psycopg2-binary==2.9.1 \
"sqlalchemy>=1.0.0, <2.0.0" \
# Create bootstrap file if it doesn't exist
if [ ! -f ~/bootstrap ]; then
echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap;
fi```
this is the full error
```+ echo Upgrading DB schema...
+ superset db upgrade
Upgrading DB schema...
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
2025-10-07 18:23:44,940:ERROR:superset.app:Failed to create app
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
File "/app/.venv/bin/superset", line 10, in <module>
sys.exit(superset())
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
super().invoke(ctx)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/app/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 238, in locate_app
return find_app_by_string(module, app_name)
File "/app/.venv/lib/python3.10/site-packages/flask/cli.py", line 166, in find_app_by_string
app = attr(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/superset/app.py", line 40, in create_app
app_initializer.init_app()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 466, in init_app
self.setup_db()
File "/app/.venv/lib/python3.10/site-packages/superset/initialization/__init__.py", line 662, in setup_db
pessimistic_connection_handling(db.engine)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 998, in engine
return self.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1017, in get_engine
return connector.get_engine()
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 594, in get_engine
self._engine = rv = self._sa.create_engine(sa_url, options)
File "/app/.venv/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py", line 1027, in create_engine
return sqlalchemy.create_engine(sa_url, **engine_opts)
File "<string>", line 2, in create_engine
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/app/.venv/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'```
can you help me @dosu?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618458
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "1yuv (via GitHub)" <gi...@apache.org>.
GitHub user 1yuv added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
This was helpful @dosu. Thank you.
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702635
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "1yuv (via GitHub)" <gi...@apache.org>.
GitHub user 1yuv added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
Hi @dosu,
Here's my bootstrapScript based on your suggestion:
```yaml
bootstrapScript: |
#!/bin/bash
apt update && apt install -y gcc libpq-dev python3-dev pkg-config
echo "installing required libs"
/app/.venv/bin/uv pip install psycopg2-binary,authlib
if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
```
And when I apply this, it fails with following error.
```
installing required libs
/bin/sh: 4: /app/pythonpath/superset_bootstrap.sh: /app/.venv/bin/uv: not found
Upgrading DB schema...
```
As you can see, looks like it's not able to find the path you suggested.
Also, I wanted to correct this `These steps are required for all production/lean images starting from Superset 4.1.x and above, not just 5.0.0`. I was able to upgrade from 4.0.2 to 4.1.2 by direclty installing using pip and not using virtual env's pip.
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702470
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "juanrondineau (via GitHub)" <gi...@apache.org>.
GitHub user juanrondineau added a comment to the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
HI @dosu , and what about the initscript? The dependecies installed from bootstrapscript also affects the pods that runns the superset-init-db-xxxxx jobs?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-14618302
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "tickwong (via GitHub)" <gi...@apache.org>.
GitHub user tickwong deleted a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
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 ?
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13773829
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Issue in psycopg2 while upgrading from 4.x to 5.0 [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Issue in psycopg2 while upgrading from 4.x to 5.0
<!-- Answer -->
You're welcome! Happy to help—just let me know if you have any more questions.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=4cc45afe-72bf-4b51-9ac1-e012e919b369) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34109#discussioncomment-13702650
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org