如何可视化任务图



我遵循官方文档,但是,在导入过程中出现错误。

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:Anacondalibsite-packagesdaskdot.py", line 11, in <module>
    graphviz = import_required("graphviz", "Drawing dask graphs requires the "
  File "C:Anacondalibsite-packagesdaskutils.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.
>>>

我正在运行Anaconda,并安装了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

我有一个目录C:AnacondaLibrarybingraphviz,里面有一堆。exe,。dll和其他文件。在PATH变量中也有一些东西:

F:>where dot
C:AnacondaLibrarybindot.bat

这是该文件的内容(C:AnacondaLibrarybindot.bat):

@echo off 
%~dp0.graphvizdot.exe %* 

我安装了dask 0.11.0:

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

这些错误在Windows和Linux (Ubuntu 16.04与所有最近的更新)中都出现。

还需要什么?

我没有使用Anaconda,但通常如果你想使用graphviz,你应该:

  1. 安装graphviz python 模块(可能是pip install graphviz)
  2. 下载并安装graphviz 软件

要在anaconda中使用dask的可视化部分,请同时安装graphviz和python-graphviz包。Dask依赖于graphviz的python接口来实现可视化。

$ conda install graphviz python-graphviz

最新更新