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 ,
I have spent nearly 1 day to solve this problem. The reason is that there is a mismatch between /usr/lib/python2.7/site-packages/ and /usr/local/lib/python2.7/site-packages/ (for my specific folder tree).
The command to use is as the following:
mv /usr/lib/python2.7/site-packages/* /usr/local/lib/python2.7/site-packages/
rmdir /usr/lib/python2.7/site-packages
ln -s /usr/local/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
I guess you will find 2 /site-packages/ also.
Just for reference for others.
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.