无法在基于 mac m1 的系统中执行命令 cqlsh。
% bin/cqlsh
Traceback (most recent call last):
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/cqlsh.py", line 159, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, cqlshhandling
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/cql3handling.py", line 19, in <module>
from cqlshlib.cqlhandling import CqlParsingRuleSet, Hint
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/cqlhandling.py", line 23, in <module>
from cqlshlib import pylexotron, util
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/pylexotron.py", line 342, in <module>
class ParsingRuleSet:
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/pylexotron.py", line 343, in ParsingRuleSet
RuleSpecScanner = SaferScanner([
^^^^^^^^^^^^^^
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/saferscanner.py", line 91, in __init__
s = re.sre_parse.State()
^^^^^^^^^^^^
AttributeError: module 're' has no attribute 'sre_parse'
如果您的计算机上同时安装了 python 3.11 和 3.10,则无需卸载任何版本。
cqlsh 可以选择将 python 解释器版本作为参数传递。
您可以将其运行为:-
./cqlsh --python /usr/local/bin/python3.10
在终端上。
看起来 Python 3.11 的同步正则表达式引擎 (SRE) 可能引入了重大更改。我已在 Cassandra 项目上为此创建了一张票证 (CASSANDRA-18088)。
在此期间,将本地 Python 降级到 3.10,应该没问题。