Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run cassandra cqlsh with python 3 on windows 10

I'm trying to run the cassandra cqlsh command using python 3 on windows 10.

When I run the command I get this error:

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

This is where the line is that it's complaining about in the script:

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 seems to be running just fine, I just need a way to connect with it.

I'm on Python 3.8.3, and I would prefer not to downgrade to 2.7 if I can help it.

How can I get this working?

like image 805
bluethundr Avatar asked Dec 18 '22 12:12

bluethundr


1 Answers

Released version of cqlsh supports only Python 2.7, so it can't work on the Python 3.x.
Support for Python 3 will be only in the Cassandra 4, that hopefully will be released this year. See CASSANDRA-15659, CASSANDRA-10190, CASSANDRA-15573 for more details.

like image 181
Alex Ott Avatar answered Dec 30 '22 02:12

Alex Ott