Unable to open cqlsh Apache cassandra - ImportError: No module named cqlshlib

前端 未结 8 745
猫巷女王i
猫巷女王i 2020-12-18 20:55

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 ,

相关标签:
8条回答
  • 2020-12-18 21:34

    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.

    0 讨论(0)
  • 2020-12-18 21:39

    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:

    • Centos6.7 ,
    • datastax3.9,
    • 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.

    0 讨论(0)
提交回复
热议问题