“RuntimeError: Make sure the Graphviz executables are on your system's path” after installing Graphviz 2.38

后端 未结 29 2238
感动是毒
感动是毒 2020-12-02 06:00

I downloaded Graphviz 2.38 MSI version and installed under folder C:\\Python34, then I run pip install Graphviz, everything went well.

相关标签:
29条回答
  • 2020-12-02 06:18

    Step 1: Install Graphviz binary

    Windows:

    1. Download Graphviz from http://www.graphviz.org/download/
    2. Add below to PATH environment variable (mention the installed graphviz version):
      • C:\Program Files (x86)\Graphviz2.38\bin
      • C:\Program Files (x86)\Graphviz2.38\bin\dot.exe
    3. Close any opened Juypter notebook and the command prompt
    4. Restart Jupyter / cmd prompt and test

    Linux:

    1. sudo apt-get update
    2. sudo apt-get install graphviz
    3. or build it manually from http://www.graphviz.org/download/

    Step 2: Install graphviz module for python

    pip:

    • pip install graphviz

    conda:

    • conda install graphviz
    0 讨论(0)
  • 2020-12-02 06:19
    import os
    os.environ["PATH"] += os.pathsep + 'D:/Program Files (x86)/Graphviz2.38/bin/'
    

    In windows just add these 2 lines in the beginning, where 'D:/Program Files (x86)/Graphviz2.38/bin/' is replaced by the address of where your bin file is.

    That solves the problem.

    0 讨论(0)
  • 2020-12-02 06:19

    This one solved the problem for me on MAC:

      brew install graphviz
    
    0 讨论(0)
  • 2020-12-02 06:19

    First, you should use pip install, and then download another package in http://www.graphviz.org/Download_windows.php and add the install location into the environmental path, then it works.

    0 讨论(0)
  • 2020-12-02 06:20
    #Write this on anaconda prompt in admin mode
    conda install -c anaconda graphviz
    conda install -c conda-forge python-graphviz
    conda install -c conda-forge/label/broken python-graphviz
    conda install -c conda-forge/label/cf201901 python-graphviz
    conda install -c conda-forge/label/cf202003 python-graphviz
    
    #check dot -v in window's cmd prompt
    C:\WINDOWS\system32>dot -V
    dot - graphviz version 2.38.0 (20140413.2041)
    (this means graphviz installed successfully)
    
    #Add path to sys and user eve variables
    PATH
    C:\Anaconda3\pkgs\graphviz-2.38-hfd603c8_2\Library\bin
    (search bin folder of graphviz and then copy n paste path in env variables)
    
    #Re-run all cmds in jyupter notebook
    #if error occurs (less chances)
    #then 
    #Restart anaconda and again run all cmds in jyupter notebook
    eg.
    import graphviz as gp
    with open("tree.dot") as f:
        dot_read=f.read()
    display(gp.Source(dot_read))
    
    0 讨论(0)
  • 2020-12-02 06:20

    try typing the following code in anaconda prompt one by one.

    this worked for me.

    Source: https://anaconda.org/conda-forge/python-graphviz

    conda install -c conda-forge python-graphviz
    conda install -c conda-forge/label/broken python-graphviz
    conda install -c conda-forge/label/cf201901 python-graphviz
    conda install -c conda-forge/label/cf202003 python-graphviz 
    
    0 讨论(0)
提交回复
热议问题