1

When executing the following command:

/usr/bin/cqlsh 127.0.0.1

Error encountered:

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

Even though I found the cqlshhandling.py script in the following directory:

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

The command which cqlsh shows /usr/local/bin/cqlsh. This is from pip install cqlsh.

Currently used command is from cassandra itself. What do I set to get cqlsh running?

jwen
  • 145
  • 2
  • 15
  • How did you install cqlsh? Sometimes reinstalling via PIP can fix this `pip install cqlsh`. Otherwise, check your PATH and make sure that your environment is using Python 2.7.11+. – Aaron Nov 19 '19 at 16:43

1 Answers1

2

The correct way is stated in the following answer.

Find the path where cqlshlib exists:

find /usr/lib/ -name cqlshlib

The path obtained (in my case) is:

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

Export the path using below variable name:

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

cqlsh installed via pip DO NOT help and COPY function will lead to the following error:

'module' object has no attribute 'parse_options'

jwen
  • 145
  • 2
  • 15