[
https://issues.apache.org/jira/browse/CASSANDRA-18642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868131#comment-17868131
]
Scott Carey edited comment on CASSANDRA-18642 at 7/23/24 5:19 PM:
------------------------------------------------------------------
This affects AlmaLinux 9 as far as I can tell. Fresh AL9 install, install
latest 4.1.x cassandra, cqlsh doesn't work.
Same with the 5.0 RC.
{noformat}
$ cqlsh --version
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 148, in <module>
from cqlshlib import cql3handling, pylexotron, sslhandling, cqlshhandling,
authproviderhandling
ModuleNotFoundError: No module named 'cqlshlib'
$ python -m site
sys.path = [
'/home/ops',
'/usr/lib64/python39.zip',
'/usr/lib64/python3.9',
'/usr/lib64/python3.9/lib-dynload',
'/usr/lib64/python3.9/site-packages',
'/usr/lib/python3.9/site-packages',
]
{noformat}
What is the recommended approach to make this work by hand for now as a
work-around?
Is there a way to have sys.path be modified to include
/usr/lib/python3.6/site-packages? Should we modify cqlsh.py manually in some
way?
5.0 beta was working on CentOS7, but now that is not supported, so we went to
the latest AlmaLinux (which should have the same problems as Rocky, Oracle,
Amazon, and RHEL 9), but that doesn't work. What is the list of places that
`cqlsh` works out of the box _at all_ from an rpm install?
EDIT:
I did this somewhat ugly, but probably OK thing to make CQLSH work, without
having to modify cqlsh.py and therefore make it a bit easier for an ansible
deploy/config for cassandra:
{noformat}
# force the python 3.9 site-packages to also include what is in 3.6
# ok here only because 3.6 is not installed and the only the cqlsh contents are
in there. This likely has other drawbacks.
sudo echo /usr/lib/python3.6/site-packages/ | sudo tee
/usr/lib/python3.9/site-packages/cassandra.pth
$ cqlsh --version
cqlsh 6.1.0
{noformat}
was (Author: scott_carey):
This affects AlmaLinux 9 as far as I can tell. Fresh AL9 install, install
latest 4.1.x cassandra, cqlsh doesn't work.
Same with the 5.0 RC.
{noformat}
$ cqlsh --version
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 148, in <module>
from cqlshlib import cql3handling, pylexotron, sslhandling, cqlshhandling,
authproviderhandling
ModuleNotFoundError: No module named 'cqlshlib'
$ python -m site
sys.path = [
'/home/ops',
'/usr/lib64/python39.zip',
'/usr/lib64/python3.9',
'/usr/lib64/python3.9/lib-dynload',
'/usr/lib64/python3.9/site-packages',
'/usr/lib/python3.9/site-packages',
]
{noformat}
What is the recommended approach to make this work by hand for now as a
work-around?
Is there a way to have sys.path be modified to include
/usr/lib/python3.6/site-packages? Should we modify cqlsh.py manually in some
way?
5.0 beta was working on CentOS7, but now that is not supported, so we went to
the latest AlmaLinux (which should have the same problems as Rocky, Oracle,
Amazon, and RHEL 9), but that doesn't work. What is the list of places that
`cqlsh` works out of the box _at all_ from an rpm install?
> cqlsh on Cassandra 4.1.2 fails on Amazon Linux
> -----------------------------------------------
>
> Key: CASSANDRA-18642
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18642
> Project: Cassandra
> Issue Type: Bug
> Components: CQL/Interpreter, Packaging
> Reporter: Stefan Miklosovic
> Assignee: Brandon Williams
> Priority: Normal
> Fix For: 4.0.x, 4.1.x, 5.x
>
> Attachments: signature.asc, signature.asc
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> I am on the newest Amazon Linux Version 2023.1.20230629
> When I install cassandra-4.1.2 from Yum repository, it starts fine but cqlsh
> prints this:
> {code}
> [ec2-user@ip-172-31-27-5 ~]$ cqlsh
> Traceback (most recent call last):
> File "/usr/bin/cqlsh.py", line 148, in <module>
> from cqlshlib import cql3handling, pylexotron, sslhandling,
> cqlshhandling, authproviderhandling
> ModuleNotFoundError: No module named 'cqlshlib'
> {code}
> If I change in /usr/bin/cqlsh.py
> {code}
> cqlshlibdir = os.path.join(CASSANDRA_PATH, 'pylib')
> {code}
> to this
> {code}
> cqlshlibdir = os.path.join('/usr/lib/python3.6', 'site-packages')
> {code}
> it works.
> I am not sure if this is the correct way to handle that as not everybody has
> python3.6. There is also no symlink pointing to this. I guess we would need
> to find where packages are for Python we are going to use in cassandra.spec
> and then change cqlsh.py to reflect that?
> {code}
> [ec2-user@ip-172-31-27-5 /]$ sudo find -type d -name site-packages
> ./usr/lib/python3.9/site-packages
> ./usr/lib/python3.6/site-packages
> ./usr/lib64/python3.9/site-packages
> {code}
> I think we need to pass whatever this (1) expands to here (2)
> (1) https://github.com/apache/cassandra/blob/trunk/redhat/cassandra.spec#L167
> (2) https://github.com/apache/cassandra/blob/trunk/bin/cqlsh.py#L78
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]