python安装Graphviz及其应用
1、开始 用 conda instll python-graphviz
安装后使用 出错提示 ‘’InvocationException: GraphViz's executables not found“
查阅资料后发现,原来我没有安装GraphViz‘s executables.我是用pip安装的Graphviz,但是Graphviz不是一个python tool,你仍然需要安装GraphViz‘s executables.
problem solved:
You need to install the GraphViz package <http://www.graphviz.org/> so that graph.dag can invoke dot.
下载windows版本的 运行以后
将graphviz安装目录下的bin文件夹添加到Path环境变量中:
4.验证是否安装并配置成功:之后验证是否安装成功
4.验证是否安装并配置成功:之后验证是否安装成功
进入windows命令行界面,输入
dot -version
,然后按回车,如果显示graphviz的相关版本信息,则安装配置成功。如图:python中运行 仍然出错
’ExecutableNotFound: failed to execute ['dot', '-Tpdf', '-O', 'iris'], make sure the Graphviz executables are on your systems' PATH‘
此前 已经 设置过环境变量不知道为何不好用
之后用以下方法 查看了环境变量,发现没有,之后追加上。
import
os
os.environ[
"PATH"
] += os.pathsep +
'C:/Program Files (x86)/Graphviz2.38/bin/'
现在就可以使用啦。