当通过常规命令安装 pip install pydot 和 brew install graphviz 之后,在代码中 import pydot 依旧不生效。
比如:在 tensorflow 使用 tf.keras.utils.plot_model 的时候,就会提示 Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work
这时候,你需要安装新版本 pydot-ng,然后 import pydot_ng as pydot。
如果是在 juypter 中使用,重启一下 jupyter。