question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python redis error

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:32 (12 by maintainers)

github_iconTop GitHub Comments

104reactions
andymccurdycommented, Sep 18, 2014

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.

4reactions
andymccurdycommented, Sep 10, 2015

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exceptions — redis-py dev documentation
By default Redis Cluster nodes stop accepting queries if they detect there is at least a hash slot uncovered (no available node is...
Read more >
redis-py/exceptions.py at master - GitHub
Error indicated CLUSTERDOWN error received from cluster. By default Redis Cluster nodes stop accepting queries if they detect there. is at least a...
Read more >
Python - How to check if Redis server is available
If you want to test redis connection once at startup, use the ping() command. ... ConnectionError, ConnectionRefusedError): print("Redis connection error!
Read more >
Redis®*: How to avoid error "Connection closed by server ...
The error "redis.exceptions.ConnectionError: Connection closed by server" is potentially related to the fact that your Python app doesn't exchange data with ...
Read more >
Python Redis: How to handle Redis exceptions - OneLinerHub
python -redisHow to handle Redis exceptions. r = redis.Redis() try: r.set('a', [1]) except redis.RedisError as re: print(re) ... catch Redis error. print(re).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found