安装可视化pydot时出现这个错误。
##错误原因
我先在cmd中安装了graphviz,然后再pip install pydot时,就出现错误提示:importError: Failed to import pydot. You must install pydot and graphviz for pydotprint
to work。
##解决
看了广大网友的建议。我把graphviz卸载了,重新安装pydot。在CMD里面显示安装成功了;但是在notebook中跑程序时,还是之前这个错误——importError: Failed to import pydot. You must install pydot and graphviz for pydotprint
to work。
再次看了广大网友的博文,说是pydot已经过期了,现在换了版本了,老的版本不能用了。所以按照以下的方式重新安装和调用:
pip uninstall pydot
pip install pydotplus
调用——import pydotplus as pydot
(注意:之前我把graphviz这个包给卸载了)
跑程序时,报新的错误InvocationException: GraphViz’s executables not found
##再次重新解决
一,先在官网下载这个包。
GraphViz下载链接: