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

后端 未结 29 2240
感动是毒
感动是毒 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:22

    Using conda install graphviz and conda install python-graphviz to install GraphViz on Windows10 the path needed was C:/ProgramData/Anaconda3/Library/bin/graphviz/ for me. I.e. adding

    import os
    os.environ["PATH"] += os.pathsep + 'C:/ProgramData/Anaconda3/Library/bin/graphviz/'
    

    solved the issue for me.

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

    I had the same error message on Mac OS (El Capitan), using the PyCharm IDE. I had installed Graphviz using brew, as recommended in RZK's answer, and installed the graphviz python package using PyCharm (I could check Graphviz was installed correctly by trying dot -V in a terminal and getting: dot - graphviz version 2.40.1 (20161225.0304)). Yet I was still getting the error message when trying to call Graphviz from PyCharm.

    I had to add the path /usr/local/bin in PyCharm options, as recommended in the answer to this question to resolve the problem.

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

    1) Graphviz – download unzip in a particular place in the system (pip does not work in windows ) and include the bin folder in the path (‘set environment variables in windows’ OR) set manually in each program

    import os
    os.environ["PATH"] += os.pathsep + 'C:/GraphViz/bin'
    

    2) Then put the model to plot

    clf = xgb.train(params, d_train, 1000, evals=evallist, early_stopping_rounds=10)
    xgb.plot_tree(clf)
    plt.rcParams['figure.figsize'] = [50, 10]
    plt.show()
    
    0 讨论(0)
  • 2020-12-02 06:28

    Try using:

    conda install python-graphviz

    The graphviz executable sit on a different path from your conda directory, if you use pip install graphviz.

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

    OSX Sierra, Python 2.7, Graphviz 2.38

    Using pip install graphviz and conda install graphviz BOTH resolves the problem.

    pip only gets path problem same as yours and conda only gets import error.

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