2017-05-08 96 views
1

我通過pip安裝了redis-py2.10.5。它安裝沒有錯誤。但是,我無法訪問與地理相關的功能。爲什麼redis-py沒有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' 

我哪裏錯了?

回答

0

r.execute_command( '西西里島13.361389 38.115556 「巴勒莫」 15.087269 37.502669')

它的工作。