由于python属性错误,无法运行cqlsh

问题描述 投票:0回答:2

无法在基于 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 cassandra cqlsh cassandra-4.0
2个回答
3
投票

如果您的计算机上同时安装了 python 3.11 和 3.10,则无需卸载任何版本。

cqlsh 可以选择将 python 解释器版本作为参数传递。

您可以将其运行为:-

./cqlsh --python /usr/local/bin/python3.10

在终端上。


2
投票

看起来 Python 3.11 的同步正则表达式引擎 (SRE) 可能引入了重大更改。我已在 Cassandra 项目上为此创建了一张票证 (CASSANDRA-18088)。

在此期间,将本地 Python 降级到 3.10,应该没问题。

© www.soinside.com 2019 - 2024. All rights reserved.