python使用pydot报错:OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
首先确保pip install pydot;pip install pydot-ng;pip install graphviz
如果还报错:原因其实不在于pydot,跟python包没有关系,而是因为graphviz需要安装二进制执行文件(跟imagick类似),所以还需要去官网下一个graphviz安装包安装:https://graphviz.gitlab.io/_pages/Download/Download_windows.html
下载gtapviz.zip解压后在系统变量中添加路径即可.
如果执行起来还有有报错的话,就用终极大法,在代码中添加其路径:
import os
os.environ["PATH"] += os.pathsep + 'G:/17/graphviz/bin/'
代码如下
- import numpy as np
- from keras.models import Sequenti