[英]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?如何解决这个问题?
Sadly common problem, you also need to install the "real" Graphviz (go here: https://www.graphviz.org/download/ )可悲的是常见问题,您还需要安装“真正的”Graphviz(去这里: https://www.graphviz.org/download/ )
Also, see I'm getting this issue when trying to run the code I found on GitHub.另外,请参阅我在尝试运行在 GitHub 上找到的代码时遇到了这个问题。 Pydot and graphivz are installed but still getting this error Pydot 和 graphivz 已安装,但仍然出现此错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.