Graphviz 環境變量設置

今天晚上解決了一個錯誤,以下:node

解決方法:spa

1、code

安裝graphviz-2.38blog

1.添加系統環境變量
table

.創建變量名GRAPHVIZ_DOT
class

值爲安裝的路徑C:\Program Files (x86)\Graphviz2.34\bin\dot.exepdf

2. 設置環境變量 在用戶環境變量添加如下一個變量 test

.創建變量名 GRAPHVIZ_INSTALL_DIR, 值爲如C:\Program Files (x86)\Graphviz2.34import

3 在系統環境變量 創建變量名PATH中添加Graphvizbin目錄路徑,如C:\Program Files (x86)\Graphviz2.34\bin變量

2、

安裝 graphviz-0.6

Python setup.py install

 

3、

>>> from graphviz import Digraph
>>> dot = Digraph(comment='The Round Table')
>>> dot.node('A', 'King Arthur')
>>> print(dot.source)
// The Round Table
digraph {
    A [label="King Arthur"]
}
>>> dot.render('test-output/round-table.gv', view=True)
'test-output/round-table.gv.pdf'

 

  

結果:

相關文章
相關標籤/搜索