0

yesterday I added pydot package by installing it via pip in command line. I can import the package and even create an object, but when I want to create a graph by:

graph.write_jpg('example1_graph.jpg')

I get the following error:

Exception: "dot.exe" not found in path.

1 Answers1

0

Try manually adding the Graphviz\bin folder to your systems PATH.

>>> import pydot
>>> pydot.find_graphviz()
{'dot': 'C:\\Program Files (x86)\\Graphviz 2.28\\bin\\dot.exe'} #...
>>> print pydot.find_graphviz.__doc__
"""
Locate Graphviz's executables in the system.

    Tries three methods:

    First: Windows Registry (Windows only)
    This requires Mark Hammond's pywin32 is installed.

    Secondly: Search the path
    It will look for 'dot', 'twopi' and 'neato' in all the directories
    specified in the PATH environment variable.

    Thirdly: Default install location (Windows only)
    It will look for 'dot', 'twopi' and 'neato' in the default install
    location under the "Program Files" directory.

    It will return a dictionary containing the program names as keys
    and their paths as values.

    If this fails, it returns None.
"""
Nihal Rp
  • 484
  • 6
  • 15
  • Hi, thanks for the answer. I have a problem though, when executing: – Westerby Oct 19 '16 at 11:10
  • AttributeError: module 'pydot' has no attribute 'find_graphviz' – Westerby Oct 19 '16 at 11:12
  • In pydot 1.2.x version,find_graphviz function has been deprecated. To fix this issue, you can install pydot 1.1.0 version here https://github.com/erocarrera/pydot/tree/v1.1.0 – Nihal Rp Oct 19 '16 at 15:24