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

Most upvoted comments

Ah, you have a file named redis.py somewhere. Python’s import will import your redis.py module instead of a package named redis. You need to rename the redis.py file to something else.

@darksmoke You likely have a file named redis.py somewhere in your code base on the Python path. You’ll need to rename it.