File "C:\Users\YOURUSERNAME\AppData\Local\conda\conda\envs\test\lib\site-packages\pydot.py", line 1922, in create
raise OSError(*args)
FileNotFoundError: [WinError 2] "dot" not found in path.
OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
前提是已经安装graphviz同时添加环境变量,使用cmd调用dot -version可以通过
windows下出现此问题原因是由于pydot的调用默认是dot程序,在cmd内自动将dot映射为dot.exe,而pydot执行过程中不会匹配创建子进程的时候直接调用dot导致出错。修改库pydot.py中的执行程序即可如下图