Grokzen / redis-py-cluster

Python cluster client for the official redis cluster. Redis 3.0+.
https://redis-py-cluster.readthedocs.io/
MIT License
1.1k stars 316 forks source link

Error importing rediscluster #465

Closed xtreme03 closed 3 years ago

xtreme03 commented 3 years ago

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)

Grokzen commented 3 years ago

@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.

axot commented 2 years ago

Got same error in python 3.9.7. I ran the code in Linux environment, is it possible caused by ext4 filesystem?

axot commented 2 years ago

Solved by rename custom script name from redis.py to another name.