當通過常規命令安裝 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。