_frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('django.test.signals') at 140668266856120

1.9k views Asked by At

I am getting this error when I go for python manage.py runserver

error - 
    _frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('django.test.signals') at 140668266856120

Please help me out. I saw other questions but it says that same model is called multiple times or same database table has been called multiple times.

2

There are 2 answers

0
Abhishek Gupta On BEST ANSWER

You can fix this by upgrading your Django version to 2.2.24 like this:

pip install --upgrade django==2.2.24
0
Micheal J. Roberts On

So this issue is likely as a result of a circular import - that is, in one module you have imported one module, and in that module you have imported the other.

Such as:

Inside notifications/serializers.py:

from books.serializers import BookSerializer

And inside books/serializers.py:

from notifications.serializers import NotificationSerializer

Hence, this causes a deadlock error...and it is very hard to pinpoint the circular import because it won't tell you where this circular import has occured.