graphviz安装问题(win 10)记录

@graphviz安装问题记录

问题1.

win10, pycharm
安装graphviz之后运行代码,出现make sure the Graphviz executables are on your systems’ PATH的错误

解决办法:
https://blog.****.net/c_daofeng/article/details/81077594

graphviz是个软件,不能单独用Pip安装

首先,下载graphviz的安装包 ,地址:https://graphviz.gitlab.io/_pages/Download/Download_windows.html
安装

设置环境变量:
用户变量:加入Path:
C:\Program Files\Graphviz 2.44.1\bin

系统变量:加入Path:
C:\Program Files\Graphviz 2.44.1\bin\dot.exe
C:\Program Files\Graphviz 2.44.1\bin

重新pip3 install graphviz

重启pycharm

问题1解决,出现问题2.

**

问题2.

**
graphviz.backend.CalledProcessError: Command '[‘dot’, ‘-Tpdf’, ‘-O’, ‘iristree’]

CalledProcessError: Command ‘[‘dot’, ‘-Tpdf’, ‘-O’, ‘BinaryTree.gv’]’ returned non-zero exit status 1. [stderr: b’Format: “pdf” not recognized. Use one of:\r\n’]

参考:https://www.tqwba.com/x_d/jishu/202661.html

解决办法:
管理员身份运行cmd

  1. 运行:dot -v
    出现问题:There is no layout engine support for “dot”…
  2. 运行:dot -c
    没有提示(成功)
  3. 再次运行dot -v,出来如下字样,成功!再去运行代码,可以了!

全部运行如下图:
graphviz安装问题(win 10)记录