-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not deserialize ATN with version (expected 4). #3997
Comments
Hi,Have you tried regenerating your parser?Envoyé de mon iPhoneLe 3 déc. 2022 à 04:15, moxi828 ***@***.***> a écrit :
OS:ubuntu 22.04
python:3.10.6
java:1.8
ATN:4.8
python runtime error:
raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").")
Exception: Could not deserialize ATN with version (expected 4).
How to solve this problem? thank you
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sorry, I'm a novice, and I don't know much about this. I'm preparing to learn related knowledge. The above error occurred when I was preparing to run a tool named PiRL. So what should I do to regenerate the parser? Thank you very much for your patience. |
I know nothing about PiRL, so can't really help. |
thank you very much |
Which file explains how to regenerate my parser?please? |
How should I regenerate my parser? Which online docs shoud l read? Thank you very much! |
Hi, I had the same issue with exactly the same error message when I tried to run the 04-Calc example from py3antlr4book. The GIT repo of py3antlr4book shipped an old version of ANTLR (antlr-4.7.2-complete.jar), which is incompatible with the latest antlr4-python3-runtime that I installed via PyPI (4.11.1). In my case, I upgraded the version of ANTLR for generating the parser and created a PR to fix the issue in the book: jszheng/py3antlr4book#15. In your case, you probably either have to regenerate the parser of the PiRL tool using the latest ANTLR or downgrade to an older version of the Python 3 package |
Try to reinstall antlr4 runtime with appropriate version: |
I downgraded my antlr4-python3-runtime to 4.9.3 and the error fixed. |
I installed with |
python |
Thank you @iliyami It works |
OS:ubuntu 22.04
python:3.10.6
java:1.8
ATN:4.8
python runtime error:
raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").")
Exception: Could not deserialize ATN with version (expected 4).
How to solve this problem? thank you
The text was updated successfully, but these errors were encountered: