Graphviz's executables are not found (Python 3.4)

后端 未结 26 1255
故里飘歌
故里飘歌 2020-11-29 05:00

I am running Python3.4 on Windows 7. I am trying to use the Python interface for graphviz. This is a script I intend to run:

from graphviz import Digraph
imp         


        
相关标签:
26条回答
  • 2020-11-29 05:54

    To solve this problem,when you install graphviz2.38 successfully, then add your PATH variable to system path.Under System Variables you can click on Path and then clicked Edit and added ;C:\Program Files (x86)\Graphviz2.38\bin to the end of the string and saved.After that,restart your pythonIDE like spyper,then it works well.

    Don't forget to close Spyder and then restart.

    0 讨论(0)
  • 2020-11-29 05:54

    For all those who are facing this issue in windows 10 even after trying the above mentiond steps, this worked for me - For Windows 10 users trying to debug this same error, launch CMD as administrator (important!) and run dot -c and then run dot -v
    This fixed the issue for me

    0 讨论(0)
  • 2020-11-29 05:54

    The simplest solution which worked for me (Windows 10, Jupyter Notebook) for this problem is to do the following:

    1. pip install graphviz
    2. restart jupyter
    3. Put the following code in notebook and execute:
    import sys
    
    sys.path.append('C:/Users/usrname/AppData/Local/Continuum/anaconda3/Library/bin/graphviz/')
    
    0 讨论(0)
  • 2020-11-29 05:56

    I encountered the same problem in Jupyter Notebook. Add this, and you are good to go.

    import os
    
    os.environ['PATH'] = os.environ['PATH']+';'+os.environ['CONDA_PREFIX']+r"\Library\bin\graphviz"
    
    0 讨论(0)
  • 2020-11-29 05:57

    I had faced same problem while trying to create decision tree through pydotplus and graphviz. And used the path variable method to resolve this issue.

    Below are the exact steps I used:

    1. Although I already had graphviz through conda install command , I re-downloaded the latest package from below path. https://graphviz.gitlab.io/_pages/Download/Download_windows.html Downloaded : graphviz-2.38.zip (Stable Release)

    2. Copied the extracted folder under following path on C: Drive. C:\Program Files (x86)\

    3. Modified the system path variable and added following path to it. Path Variable : Control Panel > System and Security > System > Advance system Setting > Environment Variable > Path C:\Program Files (x86)\graphviz-2.38\release\bin;

    4. After adding above path to environment variable , restarted the system.

    5. It worked fine , and I was able to create Decision tree into png.

      enter image description here

    0 讨论(0)
  • 2020-11-29 05:59

    I also had this problem on Ubuntu 16.04.

    Fixed by running sudo apt-get install graphviz in addition to the pip install I had already performed.

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