简体   繁体   English

如何在 Qgis 环境中使用 Graphviz Python 模块?

[英]How to use Graphviz Python module in Qgis Environment?

I installed the graphviz python module with pip commend python -m pip install graphviz我用 pip 推荐安装了 graphviz python 模块python -m Z62AD1C2A46C5298F3E2C95D3BABF8D0C

later i set the environment system variables后来我设置环境系统变量

在此处输入图像描述

在此处输入图像描述

then tried in small code in Qgis python console然后在 Qgis python 控制台中尝试了小代码

import graphviz

print('Graphviz running')
dot = graphviz.Digraph('YPN-PN-101', comment='SLD')
dot.node('YPN-CA-1', 'CABINATE')
dot.node('YPN-AN-1-1', 'AN1')
dot.node('YPN-AN-2-1', 'AN2')
dot.node('YPN-AN-3-1', 'AN3')
dot.node('YPN-AN-4-1', 'AN4')
dot.node('YPN-PN-102', 'PN')
dot.node('YPN-IJ-102', 'IJ')

dot.edge('YPN-CA-1', 'YPN-AN-1-1', label='YPN-SN-1-1')
dot.edge('YPN-AN-1-1', 'YPN-AN-2-1', label='YPN-SN-1-2')
dot.edge('YPN-AN-2-1', 'YPN-AN-3-1', label='YPN-SN-1-3')
dot.edge('YPN-AN-3-1', 'YPN-AN-4-1', label='YPN-SN-1-4')
dot.edge('YPN-AN-4-1', 'YPN-PN-102', label='FIber')
dot.edge('YPN-PN-102', 'YPN-IJ-102', label='FIber')
dot.render(directory=r'D:\SLD-diagram\doctest-output', view=True)

but it gives following error.但它给出了以下错误。

**failed to execute 'dot', make sure the graphviz executables are on your systems' path**

how to resolve this?如何解决这个问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM