skip to Main Content

I have problem with running cqshl after install Appache Cassandra on Ubuntu 24.04 LTS:

Traceback (most recent call last):
  File "/usr/bin/cqlsh.py", line 134, in <module>
    from cassandra.cluster import Cluster
  File "/usr/share/cassandra/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'

I’ve tried to update Python 3, I’ve tried to install Cassandra many times, I’ve tried to modify the YAML file associated with Cassandra in the same way as GPT-4 told me, but it even has a problem with it.

2

Answers


  1. Which version of Python 3 are you running?

    Unfortunately, cqlsh has issues with newer versions of Python 3. In fact, I know for sure that Python 3.12 breaks it (with that exact, same error message).

    Basically, downgrade to Python 3.9 and it should work.

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

    Login or Signup to reply.
  2. The error you posted indicates to me that your system is running Python 3.12. There is a known issue with that version which affects a lot of software including Cassandra (CASSANDRA-19206).

    The six module provides a compatibility layer that allows code to work with both Python 2 and Python 3 but appears to have been broken in Python 3.12 and I see a lot of reports from other software running into the same problem.

    As a workaround, you can try to reinstall six with:

    $ pip install --upgrade six
    

    Otherwise, downgrade Python and use an earlier version. Ideally, you should install and use a virtual environment so you have full control over the Python versions and modules installed. This will make sure you avoid software conflicts. Cheers!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search