redis-py: python redis error
import redis r = redis.StrictRedis(host=‘localhost’, port=6379, db=0)
as instructed in the readme file, I get this error:
File "", line 1, in
AttributeError: 'module' object has no attribute 'StrictRedis'.
just begining redis, i have this error, do have please any idea?
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 32 (12 by maintainers)
Commits related to this issue
- Rename redis file to redis_conn per https://github.com/andymccurdy/redis-py/issues/533 — committed to sagefy/sagefy by heiskr 6 years ago
Ah, you have a file named
redis.pysomewhere. Python’s import will import your redis.py module instead of a package namedredis. You need to rename the redis.py file to something else.@darksmoke You likely have a file named
redis.pysomewhere in your code base on the Python path. You’ll need to rename it.