我在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但是无法解决问题.
我在Windows 7上运行Python的pydot时遇到了麻烦.
我安装了pydot: conda install -c rmg pydot=1.2.2
我安装了graphviz ../Program Files (x86)/Graphviz2.38/
当我运行以下脚本时,我得到一个错误说
Run Code Online (Sandbox Code Playgroud)"dot.exe" not found in path
import pydot
graph = pydot.Dot(graph_type='digraph')
node_a = pydot.Node("Node A", style="filled", fillcolor="red")
node_b = pydot.Node("Node B", style="filled", fillcolor="green")
node_c = pydot.Node("Node C", style="filled", fillcolor="#0000ff")
node_d = pydot.Node("Node D", style="filled", fillcolor="#976856")
graph.add_node(node_a)
graph.add_node(node_b)
graph.add_node(node_c)
graph.add_node(node_d)
graph.add_edge(pydot.Edge(node_a, node_b))
graph.add_edge(pydot.Edge(node_b, node_c))
graph.add_edge(pydot.Edge(node_c, node_d))
graph.add_edge(pydot.Edge(node_d, node_a, label="and back we go again", labelfontcolor="#009933", fontsize="10.0", color="blue"))
graph.write_png('example2_graph.png')
Exception: "dot.exe" not found in path.
Run Code Online (Sandbox Code Playgroud)
我尝试过这个解决方案:https://stackoverflow.com/a/12257807/6561247
,添加my-paths.pth …