InvocationException:未找到GraphViz的可执行文件(Python)

时间:2017-06-04 07:48:49

标签: python graphviz

在下面的代码中调用pydotplus.graph_from_dot_data时出错:

from IPython.display import Image  

dot_data = tree.export_graphviz(clf,
                                out_file=None,
                                feature_names=iris.feature_names,
                                class_names=iris.target_names,
                                filled=True,
                                rounded=True,
                                special_characters=True)  
graph = pydotplus.graph_from_dot_data(dot_data)  
Image(graph.create_png())

错误输出:

File "C:\Users\ss\Anaconda3\lib\site-packages\pydotplus\graphviz.py", line 1960, in create 'GraphViz\'s executables not found')
InvocationException: GraphViz's executables not found

1 个答案:

答案 0 :(得分:1)

正如pydotplus所述,您需要在系统中安装GraphViz