Error "GraphViz's executables not found" when calling GraphViz layout from NetworkX in iPython notebook

concept of error
error thesaurus
error definition in computer
error definition chemistry
how to pronounce error
what is error and types of error
error formula
error mac

I received the error "InvocationException: GraphViz's executables not found, error GraphViz's executables not found" when trying to use the method graphviz_layout in my code. The code works fine when graphviz_layout is replaced by spring_layout. From the throwback exception information, it looks like it calls pydot_layout. I have the pydot module installed through Canopy's package manager, but importing it does not help. I have also pip installed graphviz and imported it with no luck.

Here is my code:

import networkx as nx
import matplotlib.pyplot as plt

keywordTreeFile = open('decode_wordnet/keywordTreeFile.TXT','r') #keyword generation file
keywordTreeFileLineData = keywordTreeFile.readlines()

G = nx.Graph()
pairData = []

for i in range(0,len(keywordTreeFileLineData)):
    pairData = pairData + [keywordTreeFileLineData[i].split('\t')]
    pairData[i][1] = pairData[i][1].rstrip('\n')
    G.add_edge(pairData[i][0],pairData[i][1])

pos = nx.graphviz_layout(G)

nx.draw(G,
        pos=pos,
        width = 1.0,
        with_labels = True,
        font_size = 3,
        linewidths=.1
        )
plt.savefig("graph.pdf")

Here is the throwback exception information:

---------------------------------------------------------------------------
InvocationException                       Traceback (most recent call last)
<ipython-input-1-e85a11cf6191> in <module>()
     15 
     16 #pos = nx.spring_layout(G,k=.15,iterations=50,scale=100)
---> 17 pos = nx.graphviz_layout(G)
     18 #labels = nx.draw_networkx_labels(G,pos)
     19 nx.draw(G,

/Users/scott/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/networkx/drawing/nx_pydot.pyc in graphviz_layout(G, prog, root, **kwds)
    245     This is a wrapper for pydot_layout.
    246     """
--> 247     return pydot_layout(G=G,prog=prog,root=root,**kwds)
    248 
    249 

/Users/scott/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/networkx/drawing/nx_pydot.pyc in pydot_layout(G, prog, root, **kwds)
    269         P.set("root",make_str(root))
    270 
--> 271     D=P.create_dot(prog=prog)
    272 
    273     if D=="":  # no data returned

/Users/scott/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pydot.pyc in <lambda>(f, prog)
   1800             self.__setattr__(
   1801                 'create_'+frmt,
-> 1802                 lambda f=frmt, prog=self.prog : self.create(format=f, prog=prog))
   1803             f = self.__dict__['create_'+frmt]
   1804             f.__doc__ = '''Refer to the docstring accompanying the 'create' method for more information.'''

/Users/scott/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pydot.pyc in create(self, prog, format)
   1951             if self.progs is None:
   1952                 raise InvocationException(
-> 1953                     'GraphViz\'s executables not found' )
   1954 
   1955         if not self.progs.has_key(prog):

InvocationException: GraphViz's executables not found

System information: I am using the lastest version and modules of Enthought Canopy on a 64-bit Mac with OS X 10.9.5. Also, I am using an iPython notebook.

I solved this by installing GraphViz on my Mac using macports:

sudo port install graphviz

Installing python packages is not enough in this case. Nonetheless, this is a dependency that should have been taken of by Enthought.

Mean Error: Definition, error, mistake, and blunder mean an act or statement that is not right or true or proper. error is used for failure to follow a model correctly. There was an error in the  Error, in applied mathematics, the difference between a true value and an estimate, or approximation, of that value. In statistics, a common example is the difference between the mean of an entire population and the mean of a sample drawn from that population.

Often, you should start with a fresh installation of Macports

  1. Remove old Macports

    sudo port -f uninstall installed sudo port clean --work --archive all

  2. Import, install and compile recent Macports sources files

    cd ~ curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.3.3.tar.bz2 tar xf MacPorts-2.3.3.tar.bz2 cd MacPorts-2.3.3/ ./configure make sudo make install port version

  3. (Optional) update Macports

    sudo port selfupdate sudo port upgrade outdated

  4. Install Graphviz using your fresh Macports

    sudo port install graphviz sudo pip install --upgrade graphviz

error vs err | Common Errors in English, Error definition, a deviation from accuracy or correctness; a mistake, as in action or speech: His speech contained several factual errors. See more. 49 synonyms of errors from the Merriam-Webster Thesaurus, plus 66 related words, definitions, and antonyms. Find another word for errors. Errors: an unintentional departure from truth or accuracy.

For ubuntu users:-

sudo apt-get install -y graphviz libgraphviz-dev

This installs the graphviz executables needed by python to display plots

Error, Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions. See below for standard  An error (from the Latin error, meaning "wandering") is an action which is inaccurate or incorrect. In some usages, an error is synonymous with a mistake. In statistics, "error" refers to the difference between the value which has been computed and the correct value.

Error, something done or written by accident that is not correct, not accurate, or does not give the right result: make/introduce an error Can I amend my VAT return online  Err definition is - to make a mistake. How to use err in a sentence. Is it human to err?

Error, NounEdit. error (countable and uncountable, plural errors). (uncountable) The state, quality, or condition of being wrong. quotations ▽. 1913, The Inland printer:​. P ress the Windows key, type Network problems, and then select Identify and repair network problems in the list.; Follow the steps in the wizard to diagnose and resolve your network problems.

Error, Synonyms for error at Thesaurus.com with free online thesaurus, antonyms, and definitions. Find descriptive alternatives for error. The following example uses @@ERROR with @@ROWCOUNT to validate the operation of an UPDATE statement. The value of @@ERROR is checked for any indication of an error, and @@ROWCOUNT is used to ensure that the update was successfully applied to a row in the table.

Comments
  • I'm getting Error: Port graphviz not found
  • 4 years later, I'd suggest installing anaconda (or at least a conda env). After doing so, it becomes a one liner to install both the Python package and the Mac app: conda install -c anaconda graphviz python-graphviz