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

llmtgqce  于 4个月前  发布在  Cassandra
关注(0)|答案(2)|浏览(65)

无法在基于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'

字符串

pkbketx9

pkbketx91#

如果你的机器上同时安装了Python 3.11和3.10,你不需要卸载任何版本。
cqlsh可以选择将python解释器版本作为参数传递。
你可以运行它:

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

字符串
在终端上。

yduiuuwa

yduiuuwa2#

看起来Python 3.11中Python的同步正则表达式引擎(SRE)可能有一个突破性的变化。我已经在Cassandra项目(CASSANDRA-18088)上为此创建了一个票证。
在此期间,将您的本地Python降级到3.10,您应该没事。

相关问题