parsewkt icon indicating copy to clipboard operation
parsewkt copied to clipboard

Fresh installation gives @rule_def NameError: name 'rule_def' is not defined, when importing

Open mavavilj opened this issue 5 years ago • 3 comments

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

mavavilj avatar May 22 '20 08:05 mavavilj

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

cleder avatar May 24 '20 12:05 cleder

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?

mavavilj avatar May 24 '20 16:05 mavavilj

@leaffan has a grako 3.x version https://github.com/leaffan/parsewkt. PR?

cleder avatar Oct 30 '24 13:10 cleder