Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

[Superset]: No module named psycopg2

Solved Go to solution

[Superset]: No module named psycopg2

New Contributor

I am trying to add a postgres database to superset. This is my connection URI: postgresql://username:password@localhost/mydatabase.
I keep getting the following error while trying to test connection: No module named psycopg2 !

I made sure I installed this module using pip install psycopg2 in shell but it's still not working!





1 ACCEPTED SOLUTION

Accepted Solutions

Re: [Superset]: No module named psycopg2

New Contributor

@Khouloud LandariIn HDP superset is installed inside a python virtual environment.

In order to install psycopg2, you will need to run following command -

/usr/hdp/current/superset/bin/pip install psycopg2

Alternatively, We package superset with pygresql and you can change the connection URI to use that -

postgresql+pygresql://user:password@host:port/dbname
2 REPLIES 2

Re: [Superset]: No module named psycopg2

New Contributor

@Khouloud LandariIn HDP superset is installed inside a python virtual environment.

In order to install psycopg2, you will need to run following command -

/usr/hdp/current/superset/bin/pip install psycopg2

Alternatively, We package superset with pygresql and you can change the connection URI to use that -

postgresql+pygresql://user:password@host:port/dbname

Re: [Superset]: No module named psycopg2

New Contributor

Thank you @Nishant Bangarwa! "No module psycopg2" solved!
Though I am getting another error now:
Error: Fatal: no pg_hba.conf entry for host "x.x.x.x", user "x", database "x", SSL off.
Plus, I am not sure about the user & password for my Postgres database

Don't have an account?
Coming from Hortonworks? Activate your account here