Search code examples
python-2.7graphvizdask

How to visualize dask graphs?


I am following the official docs, however, getting the error during import.

F:\>python
Python 2.7.11 |Anaconda custom (64-bit)| (default, Feb 16 2016, 09:58:36)[MSC v.1500 64 bit (AMD64)] on win32
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

>>> from dask.dot import dot_graph

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda\lib\site-packages\dask\dot.py", line 11, in <module>
    graphviz = import_required("graphviz", "Drawing dask graphs requires the "
  File "C:\Anaconda\lib\site-packages\dask\utils.py", line 70, in import_required
raise RuntimeError(error_msg)
RuntimeError: Drawing dask graphs requires the `graphviz` python library and the `graphviz` system library to be installed.
>>>

I am running Anaconda and have installed graphviz.

C:\>conda install graphviz
Using Anaconda API: https://api.anaconda.org
Fetching package metadata .........
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at C:\Anaconda:
#
graphviz                  2.38.0                        2

I've got a directory C:\Anaconda\Library\bin\graphviz with the bunch of .exe, .dll and other files inside. There is also something in PATH variable:

F:\>where dot
C:\Anaconda\Library\bin\dot.bat

Here is the content of that file (C:\Anaconda\Library\bin\dot.bat):

@echo off 
%~dp0.\graphviz\dot.exe %* 

I have dask 0.11.0 installed:

F:\>conda list dask
# packages in environment at C:\Anaconda:
#
Using Anaconda API: https://api.anaconda.org
dask                      0.11.0                   py27_0

These errors appear both in Windows and in Linux (Ubuntu 16.04 with all recent updates).

What else does it require?


Solution

  • I'm not using Anaconda, but generaly if you wish to use graphviz you should:

    1. Install the graphviz python module (probably with pip install graphviz).
    2. Download and install the graphviz software.