I have checked
redis-server --version
Redis server v=4.0.8 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=4d30adc486b198e5
If I try to run my code
File "app.py", line 5, in <module>
import redis
ModuleNotFoundError: No module named 'redis'
Why?
pip install redissudoif you don't have to. In fact, I would say it's bad practice to default to using sudo to install python packages.