[3.x] aiogram is looking for redis when aioredis is installed (fix imports)
See original GitHub issueChecklist
- I am sure the error is coming from aiogram code
- I have searched in the issue tracker for similar bug reports, including closed ones
Operating system
macos 12.2.1 (21D62)
Python version
3.9
aiogram version
3.0.0b5
Expected behavior
redis fsm storage works with aioredis
Current behavior
redis fsm storage does not work with aioredis
Steps to reproduce
install aiogram 3.0.0.b5
install aioredis pip install aioredis. Currently 2.0.1
create redis client redis_client = Redis.from_url("redis://localhost:6379/3")
create dispatcher dp = Dispatcher(storage=RedisStorage(redis=redis_client))
Code example
from aiogram.fsm.storage.redis import RedisStorage
from aioredis.client import Redis
redis_client = Redis.from_url("redis://localhost:6379/3")
dp = Dispatcher(storage=RedisStorage(redis=redis_client))
Logs
Traceback (most recent call last):
File "/Users/dev/projects/OWN/shopping_bot/src/bot/bot.py", line 6, in <module>
from aiogram.fsm.storage.redis import RedisStorage
File "/Users/dev/projects/OWN/shopping_bot/venv/lib/python3.9/site-packages/aiogram/fsm/storage/redis.py", line 5, in <module>
from redis.asyncio.client import Redis
ModuleNotFoundError: No module named 'redis'
Additional information
imports failing in …/env/lib/python3.9/site-packages/aiogram/fsm/storage/redis.py
from redis.asyncio.client import Redis from redis.asyncio.connection import ConnectionPool from redis.asyncio.lock import Lock from redis.typing import ExpiryT
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Aioredis is now in redis-py 4.2.0rc1! · Issue #1301 - GitHub
Aioredis is now in redis-py 4.2.0rc1+ To install, just do pip install redis>=4.2.0rc1. The code is almost the exact same.
Read more >Getting Started - aioredis
aioredis.from_url creates a Redis client backed by a pool of connections. The only required argument is the URL, which should be string representing...
Read more >aioredis 1.3.0 documentation - Read the Docs
The library is intended to provide simple and clear interface to Redis based on ... The easiest way to install aioredis is by...
Read more >API Reference — aioredis 1.3.0 documentation - Read the Docs
Redis Connection is the core function of the library. Connection instances can be used as is or through pool or high-level API. Connection...
Read more >aioredis 0.3.0 documentation - Read the Docs
hiredis parser, Yes. Pure-python parser, TBD. Low-level & High-level APIs, Yes. Connections Pool, Yes. Pipelining support, Yes. Pub/Sub support, Yes. Redis ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

There is. Maybe you’re encountering a bug in PyCharm typeshed stubs, which don’t know about
redis.asyncio. See https://youtrack.jetbrains.com/issue/PY-53965/.Check this link https://github.com/aio-libs/aioredis-py#-aioredis-is-now-in-redis-py-420rc1-