我按照GeoDjango教程(https://docs.djangoproject.com/en/1.8/ref/contrib/gis/tutorial/#geographic-models)進入遷移步驟,出現錯誤「無法導入名稱util」。我不確定問題是什麼。此外,ENGINE在settings.py文件中設置爲'django.contrib.gis.db.backends.postgis'。有誰知道如何解決這一問題?謝謝!Django:錯誤加載psycopg2
$ python manage.py makemigrations
...
__import__(name)
File "//anaconda/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 3, in <module>
from django.db.backends.postgresql_psycopg2.base import \
File "//anaconda/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 20, in <module>
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: cannot import name util