superset icon indicating copy to clipboard operation
superset copied to clipboard

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nNo module named psycopg2"

Open amoussoubaruch opened this issue 9 years ago • 7 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [ yes] I have checked the superset logs for python stacktraces and included it here as text if any
  • [yes ] I have reproduced the issue with at least the latest released version of superset
  • [ yes] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.18.5

Expected results

I am trying to connect superset to postgresql. I use this url : postgresql+psycopg2://user:pwd@ip:5432/mydatbase. Before run test connection i install pip install psycopg2 and i don't understant why i have this error :

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nNo module named psycopg2"

Actual results

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nNo module named psycopg2"

Steps to reproduce

No

amoussoubaruch avatar Jul 20 '17 16:07 amoussoubaruch

First please close #3151 as you have already been asked to. Second read the installation documentation as it's documented what you have to install for talking to postgresql databases. After you have found that out close this issue too of course.

xrmx avatar Jul 20 '17 20:07 xrmx

how did u solve it?I have the same problems

369488685 avatar Jul 17 '18 06:07 369488685

Hi,

You need to install this : pip install psycopg2 Please follow documentation : Database dependencies https://superset.incubator.apache.org/installation.html

amoussoubaruch avatar Jul 28 '18 10:07 amoussoubaruch

Hi, I am using aurora and using the same url to connect with aurora but getting error. I have already installed psycopg2.

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nNo module named 'psycopg2'"}

Please help

hamidmahmoodnbs avatar Sep 26 '18 12:09 hamidmahmoodnbs

pip install psycopg2

Now we need to install the binary

pip install psycopg2-binary

sjpatel21 avatar Jun 17 '19 18:06 sjpatel21

I faced the exact same issue, and finally realized it was b/c i was installing the pkgs on my computer but that superset was installed in a virtual environment as suggested in the install guide. I just posted the following answer to stack overflow. I hope it helps ppl:

A good indicator to see if you searched in a virtual environment is to search for where you installed superset and if it's in a folder venv, it's likely in the virutal environment.

You need to ensure that the python packages are installed in your virtual environment as well. Installing on your local computer will not work.

Go to where you installed superset (in my case /Applications/venv/), and activate the venv:

. venv/bin/activate

Install your packages

pip install psycopg2

lgellis avatar Oct 16 '19 22:10 lgellis

@lgellis Hi. Looks like you have Superset set up on Windows system. Did you encounter any errors while doing so or were you able to do so smoothly? Can someone please provide any help on this as I am unable to install on Windows even after reading documentation and trying multiple things.

SahanaHandyal avatar Jan 17 '20 09:01 SahanaHandyal