我在试着管理Cassandra cqlsh
在windows10上使用python3命令。
当我运行命令时,出现以下错误:
cqlsh
File "C:\Program Files\apache-cassandra-3.11.6\bin\\cqlsh.py", line 248
CONFIG_FILE = os.path.join(HISTORY_DIR, 'cqlshrc')
^
SyntaxError: invalid syntax
这就是它在脚本中抱怨的一句话:
if hasattr(options, 'cqlshrc'):
CONFIG_FILE = options.cqlshrc
if not os.path.exists(CONFIG_FILE):
print('\nWarning: Specified cqlshrc location `%s` does not exist. Using `%s` instead.\n' % (CONFIG_FILE, HISTORY_DIR)
CONFIG_FILE = os.path.join(HISTORY_DIR, 'cqlshrc')
Cassandra似乎运行得很好,我只是需要一个方法来连接它。
我使用的是python3.8.3,如果可以的话,我不希望降级到2.7。
我怎样才能让它工作?
2条答案
按热度按时间mmvthczy1#
发布版本
cqlsh
只支持Python2.7,因此不能在Python3.x上工作。对python3的支持只会出现在cassandra4中,有望在今年发布。详见Cassandra-15659、Cassandra-10190、Cassandra-15573。
rdrgkggo2#
对于这个问题,我有一个更好的解决方法,我有和python3.8相同的问题。我是cql的用户docker。cassandra托管在我的linux机器上,python版本是3.8。我通过docker安装cqlsh,并通过docker连接cassandra