v1.3.1 - AttributeError: 'Redis' object has no attribute 'pubsub'
robin-blanchard opened this issue · 1 comments
robin-blanchard commented
Hello, I am starting to use aioredis and I can't manage to create a Redis pubsub object with aioredis, despite following the recipe from the documentation.
Here's my code:
redis = await aioredis.create_redis(url, encoding="utf-8")
sub = redis.pubsub()
await sub.subscribe(channel)
I am getting the error: AttributeError: 'Redis' object has no attribute 'pubsub'
Output of python3 -m pip show aioredis
:
Name: aioredis
Version: 1.3.1
Summary: asyncio (PEP 3156) Redis support
Home-page: https://github.com/aio-libs/aioredis
Author: Alexey Popravka
Author-email: alexey.popravka@horsedevel.com
License: MIT
robin-blanchard commented
It seems that there are two documention:
Adapted my code with the second documentation, solved my problem.