1

I'm trying to install pydot_ng and graphviz through Anaconda Navigator but I keep getting this error for 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.

How do I proceed? I cannot use Keras visualization tools without pydot. I have installed pydot plus but Keras seems to reject it with this error in 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.
user8244
  • 127
  • 1
  • 5

2 Answers2

4

Install pydotplus (instead of pydot) for Python 3.5 + environments.

sudo conda install pydotplus

sudo conda install graphviz

Make sure you import 'pydotplus' in your code (and not pydot).

Subhasis Khatua
  • 136
  • 1
  • 4
0

You are trying to install a Python 2.7 package in a Python 3.5 environment.

Maybe this helps: How can I use conda to install pydot?

Flomp
  • 524
  • 4
  • 17