Python pydotplus.graphviz.InvocationException:graphviz';找不到s可执行文件-正在安装

Python pydotplus.graphviz.InvocationException:graphviz';找不到s可执行文件-正在安装,python,exception,graphviz,pydotplus,Python,Exception,Graphviz,Pydotplus,在windows 10中使用pycharm、python3.7 我的代码中有问题的部分是- import pandas as pd from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import pydotplus # GraphVis for tree from sklearn import tree ... clf = tree.DecisionTreeClassifie

在windows 10中使用pycharm、python3.7

我的代码中有问题的部分是-

import pandas as pd
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import pydotplus  # GraphVis for tree
from sklearn import tree
...
clf = tree.DecisionTreeClassifier()
clf.fit(X_train,y_train)
print("Decision Tree Precision:" + str(clf.score(X_test,y_test)))
dot_data = tree.export_graphviz(clf, out_file=None,
                    feature_names=no_labels.columns, # all columns
                                # without result.
                     class_names=["1","2","3"], # all unique results
                     filled=True, rounded=True,
                     special_characters=True)
graph = pydotplus.graph_from_dot_data(dot_data)
graph.write_png('wineTree.png')  # <- problem!
fig, ax = plt.subplots(figsize=(24, 24))
ax.imshow(plt.imread('wineTree.png')) #name
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.show()
将熊猫作为pd导入
从sklearn.model\u选择导入列车\u测试\u拆分
将matplotlib.pyplot作为plt导入
为树导入pydotplus#图形
从sklearn导入树
...
clf=tree.DecisionTreeClassifier()
clf.fit(X_系列、y_系列)
打印(“决策树精度:+str(clf.分数(X_检验,y_检验)))
dot_data=tree.export_graphviz(clf,out_file=None,
要素名称=无标签。列,#所有列
#没有结果。
类名称=[“1”、“2”、“3”],#所有唯一结果
填充=真,四舍五入=真,
特殊字符(为真)
graph=pydotplus.graph_from_dot_数据(dot_数据)
graph.write_png('wineTree.png')#稳定的Windows安装包,转到不存在的页面。我应该下载其他东西吗

谢谢大家!

顺便说一句-看到了吗
对于Windows可执行文件,我使用了。我按照说明进行操作,特别注意正确执行
dot-c
的步骤以及确保创建
config6
的需要。之后,请再次尝试
pydotplus
。非常感谢!我安装了它,出于某种原因,当我键入dot-c时,我得到“dot不被识别为内部或外部命令、可操作程序或批处理文件”。请确保
dot.exe
目录位于您的路径上(请参阅我链接的详细说明中的步骤10)。对我来说,我需要这个路径条目:
C:\ProgramFiles\Graphviz 2.44.1\bin
。你的可能不一样。。。并确保在进行更改后打开一个新控制台,以获取路径更改。我按照说明进行操作,特别注意正确执行
dot-c
的步骤以及确保创建
config6
的需要。之后,请再次尝试
pydotplus
。非常感谢!我安装了它,出于某种原因,当我键入dot-c时,我得到“dot不被识别为内部或外部命令、可操作程序或批处理文件”。请确保
dot.exe
目录位于您的路径上(请参阅我链接的详细说明中的步骤10)。对我来说,我需要这个路径条目:
C:\ProgramFiles\Graphviz 2.44.1\bin
。你的可能不一样。。。并确保在进行更改后打开一个新控制台,以获取路径更改。
Traceback (most recent call last):
  File "C:/Users/ASUS/PycharmProjects/DataProject/clustering/clustering.py", line 66, in <module>
    vis_tree(clf)
  File "C:/Users/ASUS/PycharmProjects/DataProject/clustering/clustering.py", line 35, in vis_tree
    graph.write_png('wineTree.png') #name
  File "C:\Users\ASUS\PycharmProjects\DataProject\venv\lib\site-packages\pydotplus\graphviz.py", line 1810, in <lambda>
    prog=self.prog: self.write(path, format=f, prog=prog)
  File "C:\Users\ASUS\PycharmProjects\DataProject\venv\lib\site-packages\pydotplus\graphviz.py", line 1918, in write
    fobj.write(self.create(prog, format))
  File "C:\Users\ASUS\PycharmProjects\DataProject\venv\lib\site-packages\pydotplus\graphviz.py", line 1960, in create
    'GraphViz\'s executables not found')
pydotplus.graphviz.InvocationException: GraphViz's executables not found