我通过pip安装了redis-py2.10.5。它的安装没有错误。但是,我无法访问与geo相关的功能。
In [1]: import redis
In [2]: r = redis.StrictRedis(host='localhost', port=6379, db=0)
In [3]: r.set('foo', 'bar')
Out[3]: True
In [4]: r.geoadd('Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-4e252ecb84dd> in <module>()
----> 1 r.geoadd('Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669')
AttributeError: 'StrictRedis' object has no attribute 'geoadd'我哪里出问题了?
发布于 2017-05-08 15:41:46
官方github回购中有一个悬而未决的问题:“StrictRedis”对象没有名为“geoadd”的对象
在问题评论中,您有两个选择:
您可以使用该问题中提到的分叉 (首选)或
pip install git+https://github.com/andymccurdy/redis-py.git。
发布于 2017-05-10 06:00:03
R.execute_command(西西里岛13.361389 38.115556“巴勒莫”15.087269 37.502669)
啊,真灵。
https://stackoverflow.com/questions/43851388
复制相似问题