ImportError:没有名为'asgiref.base_layer'的模块

时间:2016-12-26 19:26:50

标签: python-3.x redis django-channels

我正在尝试来自https://blog.heroku.com/in_deep_with_django_channels_the_future_of_real_time_apps_in_django的django频道示例,但是当我运行命令 daphne chat.asgi:channel_layer --port 8888 时,它会抛出错误 ImportError:No module named' asgiref.base_layer'即可。我已经安装了此示例所需的所有软件包。下面是我的requirements.txt文件

asgi-redis==0.13.1
asgiref==0.9
autobahn==0.12.1
channels==0.16.1
daphne==0.9.1
dj-database-url==0.4.0
Django==1.9.7
haikunator==1.0.1
msgpack-python==0.4.7
psycopg2==2.6.1
redis==2.10.5
six==1.10.0
Twisted==16.2.0
txaio==2.2.1
wheel==0.24.0
zope.interface==4.1.3

我使用的是redis-server 3.2.6和python 3.5.2

1 个答案:

答案 0 :(得分:2)

您安装的<div id="div1" class="test hide"> </div> <button id="btnToggle" onclick="toggle()" type="button" name="btnToggle">TOGGLE</button>版本比article uses更新,但channels的版本较旧。尝试更新到最新版本asgiref以解决我们的问题。