Search code examples
python-3.xredisfastapiredis-pyaioredis

Has asyncio been removed from redis-py?


I'm currently working on setting up Redis with FastAPI. This is my first time using redis and in my attempt to find out whether it was possible to use redis asynchronously, I stumbled upon aioredis-py.

According to their documentation:

enter image description here

However, my IDE is currently throwing the following error:

enter image description here

This is basically telling me that asyncio cannot be found in redis.

Has anyone faced a similar issue? What's the best to fix this?


Solution

  • It would seem this issue is unique to folks who may be using PyCharm.

    The issue pertains to a bug in typeshed and their redis stub generators. A viable workaround can be found HERE.