If you are running superset inside a virtualenv, try to install psycopg2 at system level. Also, install psycopg2-binary package.
Answer from motilio on Stack OverflowIf you are running superset inside a virtualenv, try to install psycopg2 at system level. Also, install psycopg2-binary package.
If you are using superset with Docker, you will need to install it by creating a custom image and running pip install. here is the Dockerfile and docker-compose.yml sample
Dockerfile
FROM apache/superset:latest
# Set the working directory
WORKDIR /app
# Copy and install local requirements
COPY requirements-local.txt /app/requirements-local.txt
RUN pip install -r requirements-local.txt
requirements-local.txt
psycopg2-binary
docker-compose.yml
services:
superset:
build:
context: .
dockerfile: Dockerfile
container_name: superset
restart: always
ports:
- "8088:8088"
environment:
- SUPERSET_SECRET_KEY=local
- SQLALCHEMY_DATABASE_URI=sqlite:////app/superset_home/superset.db
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
volumes:
- ./superset_home:/app/superset_home
- ./requirements-local.txt:/app/requirements-local.txt
command: ["/bin/bash", "-c", "superset db upgrade && superset init && superset run -p 8088 -h 0.0.0.0"]
redis:
image: redis:7
container_name: superset_redis
restart: always
volumes:
- ./redis_data:/data
superset 6.0.0rc1 use External database ,error。ModuleNotFoundError: No module named 'psycopg2'
Helm upgrade from 4.0.2 -> 4.1.1 fails as psycopg2 is no longer bundled into lean Superset image
superset:latest image "No module named 'psycopg2'"
Docker image for 4.1.1rc1 is missing python dependencies
Hi, I'm currently programming a school project in python and need to connect my program to a database. I'm using postgresql and have tried downloading psycopg2 using every possible pip command the internet had to offer but I keep getting a module not found error when I use 'import psycopg2'. Does anyone have any suggestions? I'm pretty new to this level of coding and wayyyyyy out of my depth. (it's running on windows if that helps)
Has anyone experienced this before, I have a FastAPI python 3.11 server running on lambda and everything works fine when I have the architecture set to x86. Tried migrating to ARM though and now I see this error for some of my endpoints:
Runtime.ImportModuleError: Unable to import module 'main': No module named 'psycopg2.\_psycopg' Traceback