pydot.InvocationException:找不到GraphViz的可执行文件 [英] pydot.InvocationException: GraphViz's executables not found

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

问题描述

我尝试运行此示例来进行决策树学习,但可以以下错误消息:

I try to run this example for decision tree learning, but get the following error message:

文件"coco.py",第18行,在 graph.write_pdf("iris.pdf")文件"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", 1602行,在 lambda路径,f = frmt,prog = self.prog:self.write(path,format = f,prog = prog))文件 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", 1696行,写 dot_fd.write(self.create(prog,format))文件"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", 1727行,在创建 '找不到GraphViz的可执行文件')pydot.InvocationException:找不到GraphViz的可执行文件

File "coco.py", line 18, in graph.write_pdf("iris.pdf") File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1602, in lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1696, in write dot_fd.write(self.create(prog, format)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1727, in create 'GraphViz\'s executables not found' ) pydot.InvocationException: GraphViz's executables not found

我看到了这篇文章关于类似的错误,但是即使我遵循他们的解决方案(以相反的顺序卸载然后重新安装graphviz和pydot),问题仍然存在...我正在使用MacOS(Yosemite).

I saw this post about a similar error, but even when I follow their solution (uninstall and then reinstall graphviz and pydot in the opposite order) the problem continues... I'm using MacOS (Yosemite).

有什么想法吗?非常感谢您的帮助.

Any ideas? Would appreciate the help.

推荐答案

cel,在评论中回答了这个问题:

cel, answered this in the comment:

Graphviz不是python工具. pypi上的python包提供了一个 在python代码中使用Graphviz的便捷方法.你还是要 安装Graphviz可执行文件,这些文件不是pythonic的,因此不是 这些软件包随附.您可以例如安装与一个 通用软件包管理器,例如自制软件

Graphviz is not a python tool. The python packages at pypi provide a convenient way of using Graphviz in python code. You still have to install the Graphviz executables, which are not pythonic, thus not shipped with these packages. You can install those e.g. with a general-purpose package manager such as homebrew

对于我个人而言,在ubuntu 14.04上,我要做的只是:

For me personally, on ubuntu 14.04, all I had to do is:

sudo apt-get install graphviz

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

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