1、在Python当中的安装
pip install graphviz -i https://mirrors.aliyun.com/pypi/simple/
截图如下:

2、运行测试程序
from graphviz import Digraph
创建有向图对象
dot = Digraph(comment='The Round Table')
添加节点
dot.node('A', 'AA')
dot.node('B', 'BB')
dot.node('C', 'CC')
添加边
dot.edges(['AB', 'AC'])
渲染图形并保存到文件
dot.render('test/table.gv', view=True)
截图如下:

3、运行测试程序中出错

看截图,说明缺少可执行文件。
4、在Graphiz官网直接下载安装包
https://www.graphviz.org/download/

下载后进行安装:

设置Path路径并重启,如下图:

5、运行程序产生图

结果符合预期