Armature python programmer question about "beancount.parser import _parser"

39 views
Skip to first unread message

Chary Chary

unread,
Jun 11, 2020, 4:22:33 AM6/11/20
to Beancount
Dear all,

sorry that I turn this into python tutorial, but I will appreciate if somebody can at least forward me to a right direction

If I look at the file parser.py it contains the following line (118):

from beancount.parser import _parser

However I do not see any _parser.py in the beancount/beancount/parser/ directory

I stumbled across this, because I tried to debug bean-report with PyCharm to see how it works, but I get an error

 
File "C:\_code\py\test\beanc\beancount\beancount\parser\parser.py", line 118, in <module>
   
from beancount.parser import _parser
ImportError: cannot import name '_parser' from 'beancount.parser' (C:\_code\py\test\beanc\beancount\beancount\parser\__init__.py)

when however I run bean-report directly from command prompt, I don't get the error.

So, I am a bit lost





Martin Michlmayr

unread,
Jun 11, 2020, 4:28:38 AM6/11/20
to bean...@googlegroups.com
* Chary Chary <char...@gmail.com> [2020-06-11 01:22]:
> from beancount.parser import _parser
>
> However I do not see any _parser.py in the beancount/beancount/parser/

_parser is built from the C files that make up the parser. It's built
when you make "make build".

--
Martin Michlmayr
https://www.cyrius.com/

Chary Chary

unread,
Jun 11, 2020, 6:45:59 AM6/11/20
to Beancount
Martin,

thanks! It helps!
Reply all
Reply to author
Forward
0 new messages