Answer the question
In order to leave comments, you need to log in
redis-py fails to start on ubuntu 10.10
Hello There is a problem using redis-py on Ubuntu 10.10
. The Redis server itself is running, redis-2.4.0-rc6 at
$ src/redis-cli
redis> set foo bar
OK
responds
redis> get foo
"bar"
Redis-py from here: github.com/andymccurdy/redis-py and installed with the command
$ sudo pip install redis
As a result, the following script works:
import redis
And if we add initialization:
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0) We
get an error:
File "redis_test.py ", line 7, in r = redis.StrictRedis(host='localhost', port=6379, db=0)
AttributeError: 'module' object has no attribute 'StrictRedis'
I understand that some other redis is being used since import redis is successful.
I removed the redis folder from /usr/local/lib/python2.6/dist-packages, but after reinstalling the same problem.
Can someone tell me what's wrong?
Thanks in advance
Answer the question
In order to leave comments, you need to log in
I didn’t go into details, but here this module is used differently pypi.python.org/pypi/redis/
examples for version 2,4,9 as well as in the repository at your link
>>> import redis
>>> r = redis.Redis(host='localhost', port=6379, db=0)
>>> r.set('foo', 'bar')
True
>>> r.get('foo')
'bar'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question