PyCharm CE is using the wrong redis typedef

I'm using a Poetry interpreter with PyCharm for my project.

I've installed the `redis` package with `poetry add redis`, and it installed fine. I wanted to use the `asyncio` package of `redis`, which was added just recently (about 4 months ago). When I import it in PyCharm, it says that the package was not found, but my code runs fine.

When I hover over `redis`, PyCharm shows me the location of some typeshed definitions that are not related to the package I've installed or my project as a whole

The installed redis.py version is `4.3.2` and asyncio support was added in `4.2`

 

Can someone please help me?

1 comment
Comment actions Permalink

Hi, please see a known issue https://youtrack.jetbrains.com/issue/PY-53965/redis-py-stub-doesnt-know-about-asyncio-module-in-reds-42-inclusion-of-aioredis

It will be fixed in one of the upcoming versions when we sync the typeshed stubs.

Meanwhile, you can use suppress inspections as a workaround.

0

Please sign in to leave a comment.