MakeMigration Error on Django - ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models' MakeMigration Error on Django - ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models' python-3.x python-3.x

MakeMigration Error on Django - ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models'


Your version of django-allauth has the incorrect import for FieldDoesNotExist. The correct import is:

from django.core.exceptions import FieldDoesNotExist

The import from django.db.models presumably worked in older versions of Django.

The import was fixed in django-allauth in version 0.41.0. If you update django-allauth in your requirements.txt or pipenv it should fix the problem.


In my case, Django version 3.1.3 conflicted with django-filter 2.0.0.

Similar error message. But the last lines of error said that it was graphene-django. However, in the middle, it says django-filter. When I looked into the django-filter source file, there was a wrong import of FieldDoesNotExist. When I upgrade django-filter to version 2.4.0, problem solved.


As I can see you have version 3.0.8.But for me, it helped when I changed requirements.txt from Django>=3.0.6(used latest 3.1 Docker image) to Django==3.0.6 as I was using the latest 3.1 version where it seems to be an issue with compatibility on 3rd party packages.