pydot and graphviz error: Couldn't import dot_parser, loading of dot files will not be possible

后端 未结 14 1405
臣服心动
臣服心动 2020-11-28 01:15

When I run a very simple code with pydot

import pydot
graph = pydot.Dot(graph_type=\'graph\')

for i in range(3):

  edge = pydot.Edge(\"king\", \"lord%d\" %         


        
14条回答
  •  我在风中等你
    2020-11-28 02:07

    Answer for pydot >= 1.1:

    The incompatibility of (upstream) pydot has been fixed by 6dff94b3f1, and thus pydot >= 1.1 will be compatible with pyparsing >= 1.5.7.


    Answer applicable to pydot <= 1.0.28:

    For anyone else who comes across this, it is due to the changes in pyparsing from 1.x to the 2.x release. To install pydot using pip, first install the older version of pyparsing:

    pip install pyparsing==1.5.7
    pip install pydot==1.0.28
    

    If you did not install pyparsing using pip, but instead used setup.py, then have a look at this solution to uninstall the package. Thanks @qtips.

提交回复
热议问题