本文介绍了pygraphviz ValueError:在路径中找不到程序点(python)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在win7(64)上遇到pygraphviz的问题.我先安装了Graphviz,然后安装了pygraphviz.当我尝试编译代码时

I am having problem with pygraphviz on win7(64). I installed Graphviz and then pygraphviz. When I try to compile my code

G=pgv.AGraph()
d={'1': {'2': None}, '2': {'1': None, '3': None}, '3': {'2': None}}
A=pgv.AGraph(d)
G.add_node(1, color='red')
G.add_edge('b','c',color='blue')
G.layout(prog='dot')
G.draw('file.png')

我收到此错误

pydev debugger: starting
Traceback (most recent call last):
  File "D:\Program Files\Eclipse\plugins\org.python.pydev_3.3.3.201401272249\pysrc\pydevd.py", line 1738, in <module>
    debugger.run(setup['file'], None, None)
  File "D:\Program Files\Eclipse\plugins\org.python.pydev_3.3.3.201401272249\pysrc\pydevd.py", line 1355, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "D:\Users\SUUSER\workspace\ThreadGraph\parseText.py", line 17, in <module>
    G.layout(prog='dot')
  File "C:\Python27\lib\site-packages\pygraphviz\agraph.py", line 1305, in layout
    data=self._run_prog(prog,' '.join([args,"-T",fmt]))
  File "C:\Python27\lib\site-packages\pygraphviz\agraph.py", line 1251, in _run_prog
    runprog=r'"%s"'%self._get_prog(prog)
  File "C:\Python27\lib\site-packages\pygraphviz\agraph.py", line 1239, in _get_prog
    raise ValueError("Program %s not found in path."%prog)
ValueError: Program dot not found in path.

不要告诉我这是重复的.我看了所有的答案.

Dont tell me it is a duplicate. I looked all answers.

(Python)ValueError:找不到程序点在路径中

PyGraphViz agraph.layout()引发I0错误

推荐答案

如果已安装Anaconda,最简单的方法是从CMD运行以下命令:

If you have Anaconda installed the simplest way to go about this is run the following from CMD:

conda install graphviz

您可能还需要以下内容:

you might also need the following:

conda install pydot-ng

这篇关于pygraphviz ValueError:在路径中找不到程序点(python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-05 11:02