cqlsh :: ImportError:无法导入名称cql_keywords_reserved

时间:2016-11-14 22:28:49

标签: python cassandra pip cqlsh

最近,我安装了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并没有错误?

1 个答案:

答案 0 :(得分:2)

您正在看到CASSANDRA-11840,这与旧版本的Python 2.7.12 +驱动程序一起出现。

要解决它,

1。)升级到Cassandra 3.8+,捆绑了没有此问题的驱动程序版本。

2.。)使您的环境/ PATH使用Python&lt; = 2.7.11

3。)CQLSH_NO_BUNDLED = 1,如您所知,但安装了具有此修复程序的驱动程序版本(cassandra-driver&gt; = 3.4.0)。