Why is pydot unable to find GraphViz's executables in Windows 8?

164,471

Solution 1

This happened because I had installed graphviz after I had installed pydot. Hence, pydot wasn't able to find it. Reinstalling it in the correct order solved the problem.

Solution 2

On Mac brew install graphviz solved the problem for me.

Solution 3

I tried adding PATH via Control Panel, but restarting the command prompt is also needed. The following also works for updating the path in a Notebook session without exiting:

import os     

os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'

Solution 4

in my case answer from Sadik pydot and graphviz error: Couldn't import dot_parser, loading of dot files will not be possible worked for me on Ubuntu 12.04.5 LTS

sudo apt-get install python-pydot

Solution 5

You need to install from Graphviz and then just add the path of folder where you installed Graphviz and its bin directory to system environments path.

Share:
164,471
web_ninja
Author by

web_ninja

Updated on July 05, 2022

Comments

  • web_ninja
    web_ninja almost 2 years

    I have GraphViz 2.32 installed in Windows 8 and have added C:\Program Files (x86)\Graphviz2.32\bin to the System PATH variable. Still pydot is unable to find its executables.

    Traceback (most recent call last):
      File "<pyshell#26>", line 1, in <module>
        graph.write_png('example1_graph.png')
      File "build\bdist.win32\egg\pydot.py", line 1809, in <lambda>
        lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog))
      File "build\bdist.win32\egg\pydot.py", line 1911, in write
        dot_fd.write(self.create(prog, format))
      File "build\bdist.win32\egg\pydot.py", line 1953, in create
        'GraphViz\'s executables not found' )
    InvocationException: GraphViz's executables not found
    

    I found this https://code.google.com/p/pydot/issues/detail?id=65 but am unable to get the problem solved.

  • boldnik
    boldnik over 9 years
    you'd better use virtualenv
  • danio
    danio over 7 years
    You don't have to restart the whole computer, just the program that you want to use. Which is probably the command prompt you are running the notebook server from.
  • dmitry
    dmitry about 7 years
    I should notice that the else clause you've pointed is not reached always. So I added explicit path at the start of the find_grapviz(). Very dirty solution of course, but stupid time waste I've made while trying to get things working is so irritating. So this is in fact good hack.
  • Dr.PP
    Dr.PP almost 7 years
    I followed your instructions in Windows 10, but Windows did not add my module path (which is in google drive) to the path list even though it showed at the Window. One way to check if your path is actually added to path list is to open a new terminal and run "path".
  • Mikebarson
    Mikebarson almost 7 years
    Worked for me! Thanks!
  • 0 _
    0 _ almost 7 years
    The order in which pydot and GraphViz are installed does not make a difference to whether pydot can find GraphViz. GraphViz executables should be in the current path, in order for pydot to be able to detect them.
  • SND
    SND over 6 years
    This solved it for me. Note: as already running applications might not automatically adapt to the updated environment, you should restart any application that requires the new path (see How do you add a windows environment variable without rebooting).
  • Akash Kandpal
    Akash Kandpal about 6 years
    Order does not matters :)
  • Simeon
    Simeon almost 6 years
    sudo aptitude install graphviz works respectively on ubuntu (18)
  • Supamee
    Supamee almost 6 years
    anyone have any idea why my graphviz folder has no bin folder? only pycache and the .py files
  • Siddharth Thanga Mariappan
    Siddharth Thanga Mariappan over 5 years
    It is working in windows 10 machine. Thanks for sharing this code
  • albert
    albert about 5 years
    Why twice the same answer stackoverflow.com/questions/28312534/… (i.e. double maintenance), better crosslink to other answer.
  • Huanfa Chen
    Huanfa Chen almost 5 years
    This worked for me, associated with another step: add the folder containing the dot.exe executable file in the path variable.
  • Vinay billa
    Vinay billa over 4 years
    Order does not matter
  • Luba Weissmann
    Luba Weissmann over 4 years
    amazing! it helped! i tried everything - but this solved it! thank you!