After installing and configuring postgres using an online tutorial. I am attempting to run the command
python manage.py makemigrations
However I get the error
...
...
File "/Users/raj/Development/mywebsite/virtual/lib/python3.5/site-packages/django/db/backends/postgresql/base.py", line 24, in <module>
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
This is in my settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '..',
'USER':"...",
"PASSWORD":"...",
"HOST":"localhost",
"PORT":"5432",
}
}
Now I came across this thread which suggests that there might be an import issue. However If i import the package in the terminal like this it doesnt complain
>>> import django.db.backends.postgresql_psycopg2
>>>
Any suggestions on what I might be doing wrong here ?
Update:
The following command does not return anything
pip freeze | grep psycopg2
Also I am using Django 2.0.4
>>> import django
>>> django.VERSION
(2, 0, 4, 'final', 0)