question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find find_graphviz()

See original GitHub issue

Where has find_graphviz() gone? It’s needed for for the documentation examples in Keras.

Python 2.7.12 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:43:17) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin Type “help”, “copyright”, “credits” or “license” for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org

import pydot pydot.find_graphviz() Traceback (most recent call last): File “<stdin>”, line 1, in <module> AttributeError: ‘module’ object has no attribute ‘find_graphviz’

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
johnyfcommented, Feb 6, 2017

Thanks for reporting this issue. This appears to be a bug in keras: https://github.com/fchollet/keras/blob/ff1f79603296bffc312076afa0589d229145924c/keras/utils/visualize_util.py#L13.

Firstly, that the line if not pydot.find_graphviz() is reached means that either pydot_ng or pydot was imported. That an ImportError is raised on the next line means that either pydot_ng was succesfully imported, or an older version of pydot. With the current pydot, an AttributeError would have been raised instead by the line if not ....

The ImportError message on this line: https://github.com/fchollet/keras/blob/ff1f79603296bffc312076afa0589d229145924c/keras/utils/visualize_util.py#L14 is inaccurate. By the reasoning above, some pydot variant was successfully imported. What cannot be found is GraphViz.

So, you need to install GraphViz and ensure that dot is in your $PATH. I would recommend opening a pull request to keras that:

  1. updates those lines to use pydot == 1.2.3, following this comment: https://github.com/erocarrera/pydot/commit/812e3c40dac1e0225391481073c64da5bafba93e#commitcomment-18236709, which was implemented in theano
  2. removes the dependence on pydot_ng
  3. possibly adds pydot == 1.2.3 to the install_requires of keras (https://github.com/fchollet/keras/blob/ff1f79603296bffc312076afa0589d229145924c/setup.py#L13).

Also, pydot_ng is unmaintained (last commit in 2015), in favor of upstream (here). The comment “pydot-ng is a fork of pydot that is better maintained.” is outdated, it was introduced with https://github.com/fchollet/keras/commit/e5d3abdf09d8c281ca8817b6292a044673ba3007, so before maintenance of pydot resumed.

0reactions
johnyfcommented, Nov 27, 2017

pydotplus is an unmaintained fork of pydot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphViz not working when imported inside PydotPlus ...
In my case I am able to find graphviz executables manually in anaconda3\Library\bin\graphviz , but I still would get the GraphViz's Executables not...
Read more >
Added Graphviz too Path but pydot cannot find dot excuable ...
I use anaconda python on windows 10 platform, install pydot by pip install pydot then install Graphviz by install package download from ...
Read more >
Test your GraphViz installation - PlantUML
This page gives information about testing your GraphViz installation for PlantUML. ... To have information about where PlantUML expects to find dot, ...
Read more >
FAQ - Graphviz
If Graphviz is built with the fontconfig library, it will be used to find the specified font.
Read more >
Install — PyGraphviz 1.10 documentation
If you've installed Graphviz and pip is unable to find Graphviz, then you need to provide pip with the path(s) where it can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found