django / channels

Developer-friendly asynchrony for Django

Home Page:https://channels.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In channels==4.0.0, Cannot import BACKEND 'channels_redis.core.RedisChannelLayer' specified for default

niranjanglynk opened this issue · comments

Traceback (most recent call last):
  File "/home/sally/app/lm-rt/venv/lib/python3.11/site-packages/channels/layers.py", line 65, in _make_backend
    backend_class = import_string(self.configs[name]["BACKEND"])
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sally/app/lm-rt/venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 30, in import_string
    return cached_import(module_path, class_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sally/app/lm-rt/venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 15, in cached_import
    module = import_module(module_path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/sally/app/lm-rt/venv/lib/python3.11/site-packages/channels_redis/core.py", line 13, in <module>
    from redis import asyncio as aioredis
ImportError: cannot import name 'asyncio' from 'redis' (/home/sally/app/lm-rt/venv/lib/python3.11/site-packages/redis/__init__.py)

Works fine in channels==3.0.4

Sorry! This is an issue with channels_redis. Not channels.