相关疑难解决方法(0)

为什么pydot无法在Windows 8中找到GraphViz的可执行文件?

我在Windows 8中安装了GraphViz 2.32,并将C:\ Program Files(x86)\ Graphviz2.32\bin添加到System PATH变量中.仍然pydot无法找到它的可执行文件.

Traceback (most recent call last):
  File "<pyshell#26>", line 1, in <module>
    graph.write_png('example1_graph.png')
  File "build\bdist.win32\egg\pydot.py", line 1809, in <lambda>
    lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog))
  File "build\bdist.win32\egg\pydot.py", line 1911, in write
    dot_fd.write(self.create(prog, format))
  File "build\bdist.win32\egg\pydot.py", line 1953, in create
    'GraphViz\'s executables not found' )
InvocationException: GraphViz's executables not found
Run Code Online (Sandbox Code Playgroud)

我发现了这个https://code.google.com/p/pydot/issues/detail?id=65但是无法解决问题.

graphviz pygraphviz pydot scikit-learn

66
推荐指数
8
解决办法
13万
查看次数

找不到Graphviz的可执行文件(Python 3.4)

我在Windows 7上运行Python3.4.我正在尝试使用graphviz的Python接口.这是我打算运行的脚本:

from graphviz import Digraph
import pydotplus

dot = Digraph(comment='The Round Table')

dot.node('A', 'King Arthur')
dot.node('B', 'Sir Bedevere the Wise')
dot.node('L', 'Sir Lancelot the Brave')
dot.edges(['AB', 'AL'])
dot.edge('B', 'L', constraint='false')

print(dot.source)
dot.render('test-output/round-table.gv', view=True)
Run Code Online (Sandbox Code Playgroud)

我在运行时收到以下错误:

RuntimeError: failed to execute ['dot', '-Tpdf', '-O', 'test-output/round-table.gv'], make sure the Graphviz executables are on your systems' path
Run Code Online (Sandbox Code Playgroud)

现在我确信我已正确安装了正确的依赖项.我首先尝试设置正确的环境变量.graphviz可执行文件位于C:\ Program Files(x86)\ Graphviz2.37\bin,所以我转到了Environment Variables部分.那里有两个部分:用户变量和系统变量.在系统变量下我单击路径然后单击Edit并添加; C:\ Program Files(x86)\ Graphviz2.37\bin到字符串的末尾并保存.这并没有清除错误.

然后,按照这里给出的答案我卸载了pydot(实际上我在这里使用pydotplus)并重新安装它,但仍然没有成功.

我一直在努力解决这个问题,而整个PATH变量只是令人困惑和令人沮丧.

python path graphviz pydot

17
推荐指数
12
解决办法
6万
查看次数

标签 统计

graphviz ×2

pydot ×2

path ×1

pygraphviz ×1

python ×1

scikit-learn ×1