This is more of a notice to be cautious for some users that cqlsh in Cassandra does not work with Python 3.12 due to a module compatibility issue. Python 3.12 is bundled with Ubuntu 24.04LTS, so be aware in case upgrading.
More on that here https://stackoverflow.com/a/78690392
This is a known bug and tracked by Cassandra project here [CASSANDRA-19206] cqlsh breaks with Python 3.12 - ASF JIRA (apache.org)
This issue is resolved in v3.29 of the datastax' cassandra-driver that drops the 'six' module dependency, though unsure, when/whether this will be part of Cassandra installation package, which is using v3.25.
It was noted: As a workaround, run cqlsh in a Python virtual environment virtualenv
where Python 3.11 is installed. I haven't tried yet. If anyone has a better idea, let's hear it, thanks.
Error message:
root@cassandra01:~# cqlsh
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'
As a workaround, you can install cqlsh even on a different Ubuntu 24.04 with Python 3.12 with snap and then remote into your cluster:
sudo snap install cqlsh
cqlsh -u admin [IP of your Cassandra node]