Skip to content
Home » django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg

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

To solve django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg error follow below methods.

ERROR LOG

File "/x/x/x/x/x/x/base.py", line 23, in ?
    raise ImproperlyConfigured("Error loading psycopg module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg

How to solve django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg ?

Refer the given methods to solve the issue.

Method 1:

Fixed it using

pip install psycopg2-binary
pip install psycopg2

Method 2 :


If you are facing this problem on a virtualenv in Ubuntu 18.4. Then solve it by installing psycopg2 v2.7.4:

pip install psycopg2==2.7.4

Hope the above solution works.

Also read :

NameError: name ‘Print’ is not defined Python