rodrigoqueiroz / geoscenarioserver

9 stars 1 forks source link

Could not deserialize ATN with version (expected 4). #107

Closed mantkiew closed 5 months ago

mantkiew commented 1 year ago

There's some problem with ANTLR deserialization causing this exception:

geoscenarioserver$ python3 GSServer.py
Traceback (most recent call last):
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/GSServer.py", line 11, in <module>
    from SimTraffic import SimTraffic
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/SimTraffic.py", line 17, in <module>
    from sv.Vehicle import Vehicle
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/Vehicle.py", line 18, in <module>
    from sv.SDVPlanner import *
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/SDVPlanner.py", line 17, in <module>
    from sv.btree.BehaviorLayer import BehaviorLayer
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/btree/BehaviorLayer.py", line 7, in <module>
    from sv.btree.BTreeInterpreter import *
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/btree/BTreeInterpreter.py", line 11, in <module>
    from sv.btree.parser.BTreeDSLLexer import BTreeDSLLexer
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/btree/parser/BTreeDSLLexer.py", line 9, in <module>
    from sv.btree.parser.BTreeDSLParser import BTreeDSLParser
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/btree/parser/BTreeDSLParser.py", line 83, in <module>
    class BTreeDSLParser ( Parser ):
  File "/home/ma/wise-sim-root/submodules/geoscenarioserver/sv/btree/parser/BTreeDSLParser.py", line 87, in BTreeDSLParser
    atn = ATNDeserializer().deserialize(serializedATN())
  File "/home/ma/.local/lib/python3.8/site-packages/antlr4/atn/ATNDeserializer.py", line 28, in deserialize
    self.checkVersion()
  File "/home/ma/.local/lib/python3.8/site-packages/antlr4/atn/ATNDeserializer.py", line 50, in checkVersion
    raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").")
Exception: Could not deserialize ATN with version  (expected 4).

Happens on Ubuntu 20.04 with

$ pip3 show antlr4-python3-runtime
Name: antlr4-python3-runtime
Version: 4.10
Summary: ANTLR 4.10 runtime for Python 2.7.12
Home-page: http://www.antlr.org
Author: Eric Vergnaud, Terence Parr, Sam Harwell
Author-email: eric.vergnaud@wanadoo.fr
License: BSD
Location: /home/ma/.local/lib/python3.8/site-packages
Requires: 
Required-by: antlr-denter

On another fresh Ubuntu install machine, we got antlr4-python3-runtime 4.11.1.

How to fix this error?

gawinwong commented 1 year ago

You can downgrade antlr4 to 4.9.3

mantkiew commented 1 year ago

Ah yes, I have implemented that in #108 .

mantkiew commented 5 months ago

Fixed in #108