Django channels: No module named 'asgiref.sync'

此生再无相见时 提交于 2020-01-30 05:15:20

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/49245396/django-channels-no-module-named-asgiref-sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!