Cassandra cqlsh无法导入cqlshhandling

时间:2019-11-19 16:06:21

标签: cassandra ubuntu-18.04 cqlsh

执行以下命令时:

A

遇到错误:

/usr/bin/cqlsh 127.0.0.1

尽管我在以下目录中找到了cqlshhandling.py脚本:

/usr/lib/python2.7/dist-packages/cqlshlib

命令Traceback (most recent call last): File "/usr/bin/cqlsh.py", line 169, in <module> from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, cqlshhandling ImportError: cannot import name cqlshhandling 显示/ usr / local / bin / cqlsh。来自which cqlsh

当前使用的命令来自cassandra本身。我该如何设置才能运行cqlsh?

1 个答案:

答案 0 :(得分:1)

正确的方法在following answer中有所说明。

找到cqlshlib存在的路径:

find /usr/lib/ -name cqlshlib

(在我的情况下)获得的路径是:

/usr/lib/python2.7/dist-packages/cqlshlib 

使用以下变量名称导出路径:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages/

通过pip安装的

cqlsh无效和COPY功能将导致以下错误:

'module' object has no attribute 'parse_options'