Reputation: 49
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.
Upvotes: 4
Views: 3330
Reputation: 6505
This was happening when using poetry
for me. I was on version 1.1.15, which was more than two years out of date. I assume me updating my Debian installation and Python several major versions caused some incompatibility somewhere.
Upgrading poetry
to version 2.0.1 fixed this issue for me!
Upvotes: 0
Reputation: 16353
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!
Upvotes: 3
Reputation: 57798
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.
Upvotes: 3