Cassandra cqlsh not running - Getting ModuleNotFoundError: No module named 'six.moves'

160 views Asked by At

Cassandra's cqlsh is not running. When I am running cqlsh, I am getting the following error in the terminal. It was working before! It's weird that it was working till yesterday. Note that I'm able to start Cassandra server with ./bin/cassandra command.

My Cassandra version: 4.1.3 My OS: macOS Sonoma (Silicon)

Traceback (most recent call last):
  File "/Users/senthilnayagan/Developer/Infra/apache-cassandra-4.1.3/bin/cqlsh.py", line 134, in <module>
    from cassandra.cluster import Cluster
  File "/Users/senthilnayagan/Developer/Infra/apache-cassandra-4.1.3/bin/../lib/cassandra-driver-internal-only-3.25.0.zip/cassandra-driver-3.25.0/cassandra/cluster.py", line 33, in <module>
ModuleNotFoundError: No module named 'six.moves'

Also, I tried running cqlsh with multiple versions of Cassandra (4.1.3 and 4.1.4), but I'm still getting the same error below. Any help would be greatly appreciated!

1

There are 1 answers

0
Aaron On

On my M2, when I try to run cqlsh with Python 3.12, I see this error as well:

  File "/Users/aaron.ploetz/local/apache-cassandra-4.1.3/bin/cqlsh.py", line 134, in <module>
    from cassandra.cluster import Cluster
  File "/Users/aaron.ploetz/local/apache-cassandra-4.1.3/bin/../lib/cassandra-driver-internal-only-3.25.0.zip/cassandra-driver-3.25.0/cassandra/cluster.py", line 33, in <module>
ModuleNotFoundError: No module named 'six.moves'

When I switch back to 3.9.6, I see this:

Connected to Aarons Cluster at 127.0.0.1:9042
[cqlsh 6.1.0 | Cassandra 4.1.3 | CQL spec 3.4.6 | Native protocol v5]
Use HELP for help.
aaron@cqlsh>

Basically, downgrade to Python 3.9 and it should work.

Note: You can also use something like pyenv to manage multiple versions of Python.