Reputation: 29
I have already installed "six" 1.7.2 in python 2.7.18 with pip, but i receive an error message anyway.
seva@seva-HLYL-WXX9:~$ python --version
Python 2.7.18
seva@seva-HLYL-WXX9:~$ pip install six==1.7.2
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Requirement already satisfied: six==1.7.2 in ./.pyenv/versions/2.7.18/lib/python2.7/site-packages (1.7.2)
seva@seva-HLYL-WXX9:~$ cqlsh
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 130, in <module>
from six.moves import configparser, input
ModuleNotFoundError: No module named 'six.moves'
seva@seva-HLYL-WXX9:~$ pip show six
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Name: six
Version: 1.7.2
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: [email protected]
License: MIT
Location: /home/seva/.pyenv/versions/2.7.18/lib/python2.7/site-packages
Requires:
Required-by: thrift
If you want to use python2.7
, open cqlsh.py
with nano:
sudo nano /usr/bin/cqlsh.py
And change python3
on python2.7
.
Upvotes: 0
Views: 115
Reputation: 16353
Since Python 2 is deprecated and has reached end-of-life (EOL), we don't recommend using it to run cqlsh since it can have unpredictable outcomes.
However, the ModuleNotFoundError
is due to known issues with Python 3.12 that affects a lot of other software, not just Cassandra. In my experience, Python introduces breaking changes in minor releases which is a pain point for users and developers.
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. The issue you posted is a variation of the same issue reported in 78001954 and 78688107.
The cqlsh utility is supported on Python 3.8 to 3.11. We are working on getting cqlsh to run on Python 3.12 (CASSANDRA-19206). As a workaround, we recommend running cqlsh in a virtual environment like virtualenv
with Python 3.11 installed. Cheers!
Upvotes: 0