当通过常规命令安装 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。

 

Refer:Python包导入错误

Refer:https://pypi.org/project/pydot-ng/

Link:https://www.cnblogs.com/farwish/p/13230246.html

相关文章:

  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2021-08-09
  • 2021-06-20
  • 2022-12-23
  • 2021-06-12
  • 2021-09-11
猜你喜欢
  • 2021-07-13
  • 2021-08-18
  • 2021-07-21
  • 2021-09-19
  • 2021-10-19
相关资源
相似解决方案