通过graphviz将点文件转换为图像时出错

2024-03-28 21:09:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我用anytree模块做了一个树图,我想从中得到一个png文件。我尝试了graphviz(点文件到png),但出现了一个错误: 有什么问题?你知道吗

Traceback (most recent call last):
  File "<pyshell#14>", line 1, in <module>
    BOM.treegraph()
  File "C:\Users\Ali\Downloads\test.test.succ4.py", line 33, in treegraph
    DotExporter (vars()[BOM.a[0].product]).to_picture ('udo.png')
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\anytree\exporter\dotexporter.py", line 232, in to_picture
    check_call(cmd)
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 342, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Tags: inpypngliblocallinealicall