【发布时间】:2020-10-29 10:39:50
【问题描述】:
我正在尝试在 Windows 10 上使用 python 3 运行 cassandra cqlsh 命令。
当我运行命令时,我得到这个错误:
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 似乎运行良好,我只需要一种方法来连接它。
我使用的是 Python 3.8.3,如果可以的话,我不希望降级到 2.7。
我怎样才能让它工作?
【问题讨论】: