cassandra 2.2 CQl Shell supports python 2.7

喜欢而已 提交于 2019-12-02 08:28:18

问题


Error I am get when trying to start cql Shell

>cqlsh
CQL Shell supports only Python 2.7
>

I have installed python2.7 but it is still giving the same error. do i have to set path some were? i have installed Cassandra 2.2 from datastax suing this command

sudo yum install dsc22

回答1:


Depending on your distribution and its version you cannot change the default python version of the system without breaking the system. If you have Python 2.7 installed then its interpreter is probably on your path as python2.7.

Try running python2.7 --version. If that gives you an output like Python 2.7.x you are good. Just edit the cqlsh script and replace python with python2.7 at the beginning of the only code line in the file.




回答2:


You should use python 2.7 but be aware of https://issues.apache.org/jira/browse/CASSANDRA-11850




回答3:


Not enough rep to post as a comment. If you encounter same problem as @andrewdeal and you installed Python 2.7 side-by-side (a must on CentOS 6 which requires Python 2.6), you need site-packages in your Python 2.7 install.

As root:

rm /usr/local/lib/python2.7/site-packages/README
rmdir /usr/local/lib/python2.7/site-packages
ln -s /usr/lib/python2.7/site-packages/ /usr/local/lib/python2.7

You can now run cqlsh




回答4:


I tried doing that change from python to python2.7 and then got:

Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 152, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
ImportError: No module named cqlshlib


来源:https://stackoverflow.com/questions/35314104/cassandra-2-2-cql-shell-supports-python-2-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!