1

After completing the installation of python djnago perfectly. When running a command

"python manage.py runserver"

getting an error like

raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'

DMH
  • 3,875
  • 2
  • 26
  • 25

2 Answers2

0

Did you install dev packages? assuming that you have already installed psycopg2 if not and if you are on ubuntu do this sudo apt-get install libpq-dev python-dev

Aditya Pandhare
  • 501
  • 7
  • 16
0

First Install its dependencies,

sudo apt-get build-dep python-psycopg2

Then install psycopg2 python module,

pip install psycopg2 

If it shows error then install this and try above ,

sudo apt-get install libpq-dev
Mohideen bin Mohammed
  • 18,813
  • 10
  • 112
  • 118