Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.4 graphviz问题_Python_Path_Graphviz - Fatal编程技术网

Python 3.4 graphviz问题

Python 3.4 graphviz问题,python,path,graphviz,Python,Path,Graphviz,我必须在Jupyter笔记本上运行以下代码 from graphviz import Digraph 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', constra

我必须在Jupyter笔记本上运行以下代码

from graphviz import Digraph
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)
我必须事先安装graphviz。在windows 10上安装graphviz 2.38之后。我做了“pip安装graphviz” 以及“conda安装graphviz”。但是我得到了这个错误

运行时错误:无法执行['dot','-Tsvg'],请确保Graphviz可执行文件位于系统的路径上


我还应该做些什么来消除此错误?

您的python运行时使用的PATH环境变量不包括指向graphviz的路径

您可以通过检查以下(py3)代码是否正确来确认这一点:

列出安装graphviz的目录。如果没有,请修改系统路径环境变量[1],或在每次运行python之前使用以下命令将路径添加到graphviz二进制文件:

set PATH=%PATH%;this_would_be_the_path_to_your_graphiz_binaries_like_dot
[1]

set PATH=%PATH%;this_would_be_the_path_to_your_graphiz_binaries_like_dot