Recent version of pyparsing (3.0.2) doesn't work well with pydot
See original GitHub issueRef: https://github.com/pyparsing/pyparsing/issues/319
Minimal example:
import pydot
pydot.graph_from_dot_data("graph G { b1 [label=<Hello World>]; }")
graph G { b1 [label=<Hello World>]; }
^
Expected '{', found 'G' (at char 6), (line:1, col:7)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
pyparsing 3.0.2 broke pydot · Issue #319 - GitHub
MarcCote mentioned this issue on Oct 27, 2021. Recent version of pyparsing (3.0.2) doesn't work well with pydot pydot/pydot#277. Open.
Read more >pydot and graphviz error: Couldn't import dot_parser, loading ...
To install pydot using pip, first install the older version of pyparsing: pip install pyparsing==1.5.7 pip install pydot==1.0.28.
Read more >pydot · PyPI
About. pydot : is an interface to Graphviz; can parse and dump into the DOT language used by GraphViz,; is written in pure...
Read more >1 What's New in Pyparsing 3.0.0
Pyparsing 3.0 will run both versions of this example. New code should be written using the PEP-8 compatible names. The compatibility synonyms will...
Read more >Pip Package — catkin_pip 0.2.3 documentation
You can upgrade to a newer version of Python to solve this. ... might need to move to a directory where the module...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue is now resolved in pyparsing 3.0.3. That should probably be reflected in the requirements of
pydot
.I’ve looked at the networkx issue, and the issue is due to the tightening up of whitespace-skipping that was pushed out in 3.0.2. This is intentional behavior. To correct in pydot, add the two lines shown below to dot_parser.py (I can submit as a PR if you prefer):
CharsNotIn has always suppressed whitespace, but in pyparsing 3.0, it is intended to preserve this whitespace-skipping suppression when enclosed in a surrounding expression. My understanding of
alphastring_
is that it should collect non-comma characters after skipping over any initial whitespace. Adding this line passes the test suite. (The added comment is optional, but I thought it would be useful to document this atypical attribute setting.)This fix also will address issues with pydot in networkx (pyparsing/pyparsing#338).