skip to Main Content

I have two imports

import redis
from redis.commands.json.path import Path

redis is installed, however I’m getting

ModuleNotFoundError: No module named 'redis.commands'

Any solution for that?

2

Answers


  1. Most likely you have an older version of the Redis libraries. Try:

    pip install --upgrade redis
    
    Login or Signup to reply.
  2. Install redis correctly:

    $ python -m pip install --upgrade redis
    

    If you are using conda:

    $ conda install -c conda-forge redis-py
    

    Then try:

    import redis
    from redis.commands.json.path import Path
    # ...
    

    See the redis-py documentation for more information.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search