parsewkt
parsewkt copied to clipboard
Fresh installation gives @rule_def NameError: name 'rule_def' is not defined, when importing
I just did a fresh install using
pip install parsewkt
Then I open up Python interpreter and do and get:
>>> import parsewkt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\matti\Developer\anaconda3\envs\myenv\lib\site-packages\parsewkt\__init__.py", line 2, in <module>
from .wkt import from_wkt
File "C:\Users\matti\Developer\anaconda3\envs\myenv\lib\site-packages\parsewkt\wkt.py", line 3, in <module>
from .parse import WktSemantics, WktParser
File "C:\Users\matti\Developer\anaconda3\envs\myenv\lib\site-packages\parsewkt\parse.py", line 17, in <module>
class WktParser(Parser):
File "C:\Users\matti\Developer\anaconda3\envs\myenv\lib\site-packages\parsewkt\parse.py", line 22, in WktParser
@rule_def
NameError: name 'rule_def' is not defined
The grako version I used at the time was https://pypi.org/project/grako/2.2.2/ please try to run it with that version. I assume that grako 3.x introduced breaking changes
You mean that I have to install and use grako somehow in addition to "pip install parsewkt"?
I didn't understand whether it asked to run that grako command during install, since the description of "installation" is a bit lousy here:
https://github.com/cleder/parsewkt
That is,
Do I need to perform:
"The generation of parse.py is as easy as: /path/to/grako Wkt.ebnf -o parse.py"
after doing the pip install?
@leaffan has a grako 3.x version https://github.com/leaffan/parsewkt. PR?