I've noticed other answers are all but stating the obvious of doing a pip
install or running the setup.py
script from the source. These are clearly helpful for some but there are other potential issues that might be preventing the import redis
statement from running without error.
I've been bitten by this situation where my default Python version did not match up with the pip
version and install path.
For example:
pip install redis
Will install redis
but using the path to Python3.11 and my interpreter (i.e. default path for Python) was using Python3.09.
You will in effect need to make the change from one end or the other. Either by setting your default interpreter to v3.11
or by using the pip
install command for the correct default interpreter v3.09
or whichever is in use.
Hope this helps!