RuntimeError: ANTLR version mismatch

文章讲述了在使用nemonik/Intellect规则引擎时遇到的ANTLR版本不匹配问题,由于运行时版本3.1.3不支持ANTLR3.4,作者提供了从GitHub下载并替换相应ANTLRPythonruntime的解决方法,建议关注后续更新。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

规则引擎源码:

nemonik/Intellect: DSL and Rules Engine For Python (github.com)

运行程序 Example.py 时报错

RuntimeError: ANTLR version mismatch: The recognizer has been generated with API V0, but this runtime does not support this.

原因:

Antlr 版本是 3.4

Runtime的版本是3.1.3

解决方法:

重新下载个3.1.3版本的antlr_python_runtime.

Pypi 上的下载不了,我这里用github上的替换了,链接是:website-antlr3/download/Python at gh-pages · antlr/website-antlr3 (github.com)

(github下载不了的可以从antlr-python-runtime-3.1.3.zip资源-优快云文库下载)

持续更新,请多多关注~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值