You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While, technically, this isn't something that one should do, we hit this problem because of our complicated dependencies, where an internal library we use in our async code also depends on an older redis, even though that part is not used by our async code.
I think rather than hardcoding a version check, an import redis.asyncio in the try/except block.
The text was updated successfully, but these errors were encountered:
I guess it's a little complex when it comes to optional dependencies. If you used aiocache[redis], then the dependency resolution would work correctly and require 4.2+. Maybe we can tweak that import as suggested though (although I expect most users will already have migrated and won't encounter this issue).
#745
I faced this issue when using this library https://pypi.org/project/profanity-filter/ which requires redis<4.0 (apparently although I managed to fix this issue by just bypassing the requirements)
There definitely should be a version check for >=4.2.0 though because finding the source of this issue was a pain
Really frustrating cause I only needed to use the memory based cache
The Python redis library didn't have async support before 4.2.0, but the check for whether redis is installed doesn't take that into account:
aiocache/aiocache/__init__.py
Line 14 in 19e0466
If
redis
is importable, the code then goes on to importredis.asyncio
, which for older versions doesn't exist:aiocache/aiocache/backends/redis.py
Line 5 in 19e0466
While, technically, this isn't something that one should do, we hit this problem because of our complicated dependencies, where an internal library we use in our async code also depends on an older redis, even though that part is not used by our async code.
I think rather than hardcoding a version check, an
import redis.asyncio
in the try/except block.The text was updated successfully, but these errors were encountered: