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'
superset:latest image "No module named 'psycopg2'"
Helm upgrade from 4.0.2 -> 4.1.1 fails as psycopg2 is no longer bundled into lean Superset image
Docker image for 4.1.1rc1 is missing python dependencies
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
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)
Hi All
i get cloning from existing heroku app
when i try to Re run my project on Heroku this bug come in
PS : i already installed psycopg2
I had the same problem, it was that psycopg2 does not install well in Windows with _easy_install_, I followed the instructions on the follow SO answer:
Installing psycopg2 (postgresql) in virtualenv on windows
You need to manually install the psycopg2 exe file:
psycopg2-2.4.2.win-amd64-py2.7-pg9.0.4-release.exe
I know this is going to haunt me again or as nwcell puts it:
Every time I need to set up psycopg2 on windows, I wind up wanting to shoot something.
I actually have a machine with it working and I've been at pains to setup another machine. I installed Python 3.8 and the old PC has 3.7.4. The main difference was the file:
C:\project\venv\Lib\site-packages\psycopg2_psycopg.cp37-win32.pyd
On the new PC it was showing as AMD64. I eventually uninstalled 3.8 and reverted back to 3.7.4, then I copied the files from the old PC to the new and then I hit this error:
https://stackoverflow.com/a/37819509/495455
Going to a WayBackMachine version of the stickpeople:
https://web.archive.org/web/20191003103502/http://www.stickpeople.com/projects/python/win-psycopg/
I didn't install the exe, I simply did a pip install -Iv psycopg2-binary==2.8.4 at which point it started working. So I'm thinking the latest version doesn't work, for me 2.8.4 still works: https://pypi.org/project/psycopg2/#files
It's something to do with x64 as everything I tried with AMD64 didn't work and I spent ages on it.