最近,我在安装后安装了Cassandra. 3.6,我得到了一个错误。
Connection error: ('Unable to connect to any servers', {'127.0.0.1': TypeError('ref() does not take keyword arguments',)})为了解决这个问题,我遵循了以下原则
pip install cassandra-driver==2.7.2
pip install cassandra-driver
export CQLSH_NO_BUNDLED=true我的python版本是2.7
现在,当我运行cqlsh时,我得到了以下错误
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 167, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
File "/usr/lib/python2.7/dist-packages/cqlshlib/cql3handling.py", line 17, in <module>
from .cqlhandling import CqlParsingRuleSet, Hint
File "/usr/lib/python2.7/dist-packages/cqlshlib/cqlhandling.py", line 21, in <module>
from cassandra.metadata import cql_keywords_reserved
ImportError: cannot import name cql_keywords_reserved如何解决此错误?如何才能运行cassandra而不出现错误?
发布于 2016-11-17 05:57:09
您看到的是Python 2.7.12+的旧版本驱动程序中出现的CASSANDRA-11840。
来解决这个问题,或者
1.)升级到Cassandra 3.8+,它捆绑了一个没有这个问题的驱动程序版本。
或
2.)使您的环境/路径使用Python <= 2.7.11
或
3.)正如您所猜测的那样,驱动程序需要安装一个带有补丁的驱动程序版本(cassandra- CQLSH_NO_BUNDLED=1 >= 3.4.0)。
https://stackoverflow.com/questions/40598910
复制相似问题