如何在spyder 3.6中导入pydotplus

2024-05-08 09:15:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前在Windows8操作系统上使用Spyder3.6,每当我运行此代码时 它显示出一个错误

文件“”,第12行,in 导入pydotplus

ModuleNotFoundError:没有名为“pydotplus”的模块

这是密码

import pydotplus 
dot_data = tree.export_graphviz(clf, out_file=None) 

graph = pydotplus.graph_from_dot_data(dot_data) 

graph.write_pdf("iris.pdf") 

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())

Tags: fromimporttruetreeirisdatanamesplus