找不到GraphViz的可执行文件:Anaconda-3 [英] GraphViz's executables not found : Anaconda-3

查看:298
本文介绍了找不到GraphViz的可执行文件:Anaconda-3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图显示树的输出,但是当我运行下面的脚本时,出现如下错误:

I am trying to display the tree output , but when I run the script below, I receive an error like :

InvocationException:找不到GraphViz的可执行文件

InvocationException: GraphViz's executables not found

我在这里搜索了类似的主题,但是其中大多数与Mac相关.我使用的是Windows 10 64位操作系统,而我使用的是Anaconda-3 64位.我很想听听您对此的建议.

I've searched similar topics here, but most of them are Mac related. I'm using Windows 10 64-bit operating system, and I use Anaconda-3 64 bit. I'd love to hear your suggestions on this.

#Displaying the decision tree
from sklearn import tree
#from StringIO import StringIO
from io import StringIO
#from StringIO import StringIO 
from IPython.display import Image
out = StringIO()
tree.export_graphviz(classifier, out_file=out)

import pydotplus
graph=pydotplus.graph_from_dot_data(out.getvalue())
Image(graph.create_png())

edit:我再次安装了graphviz和pydotplus模块,但现在仍然可以使用.

edit : I've installed graphviz and pydotplus modules again, but still now working.

推荐答案

我遇到了同样的问题.这是((Win10,Anaconda3,Jupyter notebook,python 3.x)的解决方案

i had same problem. Here is the solution for ((Win10, Anaconda3, Jupyter notebook, python 3.x)

  1. 下载并安装 https://graphviz.gitlab.io/_pages/下载/Download_windows.html

conda安装graphviz

conda install graphviz

  • 将graphviz安装路径(C:... \ graphviz \ bin)添加到 控制面板>系统和安全>系统>高级系统设置>环境变量>路径>编辑>新建

  • Add graphviz installed path (C:...\graphviz\bin) to Control Panel > System and Security > System > Advanced System Settings > Environment Variables > Path > Edit > New

    此处针对不同的操作系统回答了此问题:> Graphviz的可执行文件不是找到(Python 3.4)

    This question is answered for different OS here: Graphviz's executables are not found (Python 3.4)

    这篇关于找不到GraphViz的可执行文件:Anaconda-3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆