如何为 Windows 64、Python 3.6 安装 pydot_ng 和 graphviz?

How to install pydot_ng and graphviz for Windows 64, Python 3.6?

我正在尝试通过 Anaconda Navigator 安装 pydot_ng 和 graphviz,但我一直收到 pydot_ng (1.0.0.15) 的错误:

UnsatisfiableError: The following specifications were found to be in conflict:
  - pydot-ng -> python 2.7*
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.

我该如何进行? 没有 pydot,我无法使用 Keras 可视化工具。 我已经安装了 pydot plus,但 Keras 似乎在 iPython notebook.

中因这个错误而拒绝了它
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\utils\vis_utils.py", line 131, in plot_model
    dot = model_to_dot(model, show_shapes, show_layer_names, rankdir)

  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\utils\vis_utils.py", line 52, in model_to_dot
    _check_pydot()

  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\utils\vis_utils.py", line 27, in _check_pydot
    raise ImportError('Failed to import pydot. You must install pydot'

ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.

您正在尝试在 Python 3.5 环境中安装 Python 2.7 包。

也许这有助于: How can I use conda to install pydot?

为 Python 3.5 + 环境安装 pydotplus(而不是 pydot)。

sudo conda install pydotplus

sudo conda install graphviz

确保在代码中导入 'pydotplus'(而不是 pydot)。