every time i try to make connection between python and PSQL this error disappear ?

enter image description here

  • The error message tells you that u is a NoneType, which does not have an attribute _instantiate_plugins. It seems likely, then, that u is not instantiated as the object you think it is. – DinoCoderSaurus Mar 2 '19 at 2:27

Looking at the information provided the issue could be the os.getenv("DATABASE_URL") which evaluates to None in the event of non existent environment variable. Hence, double check whether you have set the DATABASE_URL in your environment.


I noticed that the 2018 lecture for SQL only specified to set the database URL to ours but didn't go through it. I was able to run the code after doing the following (I'm using Linux and Python3): 1. Install psycopg2 within pip $ sudo pip3 install psycopg2 2. Set DATABASE_URL $ export DATABASE_URL="postgresql:///(database name)" note that other sources say that it's "postgresql://localhost/(database name) but my code worked when I omitted the localhost 3. Run the python file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .