Error importing rediscluster
xtreme03 opened this issue · 3 comments
Used pip3 to install redis-py-cluster
pip3 install redis-py-cluster
from rediscluster import RedisCluster
.
Giving the following error
File "/Users/pallab.nag/india/redis.py", line 1, in <module> from rediscluster import RedisCluster ImportError: cannot import name 'RedisCluster' from partially initialized module 'rediscluster' (most likely due to a circular import) (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/rediscluster/__init__.py)
@xtreme03 The error message says itself what the issue is, you have a circular import where rediscluster
package is installed twice or you have a separate file/module named rediscluster.py somewhere where you should not have. Print out all paths in sys.path
that is used for imports and see where you have the two versions of rediscluster.py or that as a module and remove one of them and your code will start to work.
Got same error in python 3.9.7. I ran the code in Linux environment, is it possible caused by ext4 filesystem?
Solved by rename custom script name from redis.py
to another name.