Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django channels: No module named 'asgiref.sync'

I am following this guide for channels tutorial (https://media.readthedocs.org/pdf/channels/latest/channels.pdf) and after adding channels to top of INSTALLED APPS, adding ASGI_APPLICATION = 'mysite.routing.application' to my setting file and creating following routing.py:

# .../routing.py
from channels.routing import ProtocolTypeRouter

application = ProtocolTypeRouter({
      # (http->django views is added by default)
})

I am getting this error after running python manage.py runserver:

ModuleNotFoundError: No module named 'asgiref.sync'

I have following versions of libraries:

Django (1.11.5)
asgiref (1.1.2)
channels (2.0.2)
...

Can someone help me ? I am new to channels.

like image 407
Michal Hucko Avatar asked Mar 12 '18 22:03

Michal Hucko


1 Answers

I found out the problem was with old version of asgiref I just had to update django and it updated also the asgiref package.

like image 58
Michal Hucko Avatar answered Sep 23 '22 01:09

Michal Hucko