pydot.InvocationException: GraphViz's executables not found

后端 未结 11 757
自闭症患者
自闭症患者 2021-02-07 03:22

I try to run this example for decision tree learning, but get the following error message:

File \"coco.py\", line 18, in graph.write_pdf(\"iris.pdf

相关标签:
11条回答
  • 2021-02-07 03:59

    I was facing the same issues, my problem got resolved using:

    1. Run the command sudo port install graphviz
    2. If error is coming for the port then first install port from below based on the version you are using https://guide.macports.org/chunked/installing.macports.html
    3. After installation of port run command sudo port install graphviz

    Restart the python kernel if you are using iPython and run again.

    0 讨论(0)
  • 2021-02-07 04:02

    I did face similar issue and the way it was corrected was by changing the path.

    This is what I did :

    Copy paste "graphiz" path from your computer to Environment variable>Path from the control panel

    Example: Graphiz path : C:\Apps\Program Files\Continuum\Anaconda2\Library\bin\graphviz)

    (I had installed it on Apps folder. It could be in a diff path for you)

    Setting path in Environment Variable :

    Go to Control Panel>Control Panel\System and Security\System .Click Advanced Setting and then Advanced .You'll find Environment variables at bottom right. Click Path to edit and save it . Close your IDE and re open it .

    It worked for me .

    0 讨论(0)
  • 2021-02-07 04:03

    On Windows 8 this solved the same problem for me:

    import os     
    os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'
    
    0 讨论(0)
  • 2021-02-07 04:04

    cel, answered this in the comment:

    Graphviz is not a python tool. The python packages at pypi provide a convenient way of using Graphviz in python code. You still have to install the Graphviz executables, which are not pythonic, thus not shipped with these packages. You can install those e.g. with a general-purpose package manager such as homebrew

    For me personally, on ubuntu 14.04, all I had to do is:

    sudo apt-get install graphviz
    
    0 讨论(0)
  • 2021-02-07 04:04

    I had the same issue when installing pydot and graphviz with pip, then I found the answer here.

    In particular, I first uninstalled pydot and graphviz which I separately installed using pip (using sudo pip uninstall pydot and the same for graphviz). Then, I run sudo apt-get install python-pydot which fixed the issue.

    0 讨论(0)
  • 2021-02-07 04:08

    If you are on mac operating system then you might face this issue . I have installed graphviz with pip but dint work . So I had to install it with brew again and worked for me.

    use following command

    brew install graphviz

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