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

前端 未结 27 2566
醉酒成梦
醉酒成梦 2020-11-27 14:26

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 executab

相关标签:
27条回答
  • 2020-11-27 14:40

    On Anaconda distro, pip install did not work. I did a pip uninstall graphviz, pip uninstall pydot, and then I did conda install graphviz and then conda install pydot, in this order, and then it worked!

    0 讨论(0)
  • 2020-11-27 14:42

    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/'
    
    0 讨论(0)
  • 2020-11-27 14:42

    Tried all installation sequence as described in all solutions/posting/blogs, finally realized anaconda was not able to read the Environment variables. Closed Anaconda and Spyder. Then opened Anaconda in Administrator mode (on Windows 64 bit OS machine) and then opened Spyder. Script worked fine with PYDOT calls.

    0 讨论(0)
  • 2020-11-27 14:43

    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

    0 讨论(0)
  • 2020-11-27 14:43

    Add dot.exe to your path. right click my computer > advanced system settings > environment variables > high light 'path' > edit then append everything in the quotes to path ";C:\Program Files (x86)\Graphviz2.34\bin\" depending on where you installed Graphviz ofcourse.Then restart the python shell and type.

    import pydot pydot.find_graphviz() Make sure there is a slash after 'bin' so it gets everything from inside the folder, I tried with out the slash and the above code returned nothing, however after adding the slash it returned the graphviz executables it needed and their paths.

    0 讨论(0)
  • 2020-11-27 14:43

    I am not using a windows machine, I am on a linux platform. I ran across this executable-not-found issue in the context of using the python package pyAgrum for plotting bayesian networks. pyAgrum uses graphviz to plot the networks. I installed pyagrum and graphviz using the anaconda platform in a python 3.6.4 environment (i.e. conda install <package name>).

    I found the executables in /conda/envs/<environment name>/bin directory. So, it was just a matter of getting my notebook kernel to find them.

    If you import os, use the command os.environ['PATH'].split(os.pathsep) to see the executable paths in which your environment is looking. If the path containing your graphviz executables isn't in there, you can add it by doing the following: os.environ['PATH'] += os.pathsep + <path to executables>.

    I imagine this solution will work outside of my context. The main downside to this solution is that you need to do it every time you restart the kernel.

    0 讨论(0)
提交回复
热议问题