I am new to cassandra ! Have downloaded the apacahe cassandra 2.1.2 package and initialy was able to connect to cqlsh but then after installing CCM i am unable to connect , will get the following error
Traceback (most recent call last):
File "bin/cqlsh", line 124, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron,sslhandling, copy
ImportError: No module named cqlshlib
Thanks in advance !
Spent a couple of days, scouring the net moving renaming copying packages .
Easiest workaround for this error that worked :
pip install cqlsh
You could export PYTHONPATH, to include site package folder where cqlshlib exists
First find the path where cqlshlib exists
find /usr/lib/ -name cqlshlib
Export the path using below variable name
export PYTHONPATH=/usr/lib/python2.7/site-packages/
I have tried their ways, but failed. And I think cqlsh
just cannot find the exact path to cqlshlib.so
;
I solved it this way:
my cqlshlib
path:/usr/local/lib/python2.7/site-packages/
vim /usr/bin/cqlsh.py
and add the path of cqlshlib
after import sys
, the file looks like:
...
import sys
...
from uuid import UUID
sys.path.append("/usr/local/lib/python2.7/site-packages") #add this sentence`
Then I execute cqlsh
, it works.
If you're in the cassandra directory, run:
bin/cqlsh
If you check the cqlsh you're running with which cqlsh
i suspect you're hitting the ccm one and missing something in your path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With