django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg

I had the error as well; although psycopg2 was installed on my system using apt-get, my virtualenv couldn’t find it:

>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named psycopg2

It was fixed by doing a pip install psycopg2-binary inside the virtualenv (or pip install psycopg2 for <2.8 psycopg2 versions).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)