python-2.7 - 如何可视化 dask 图?

标签 python-2.7 graphviz dask

我正在关注official docs但是,在导入过程中出现错误。

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.
>>>

我正在运行 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:\Anaconda\Library\bin\graphviz,里面有一堆.exe、.dll 和其他文件。 PATH 变量中还有一些内容:

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

这是该文件的内容 (C:\Anaconda\Library\bin\dot.bat):

@echo off 
%~dp0.\graphviz\dot.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. Download并安装 graphviz 软件

关于python-2.7 - 如何可视化 dask 图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39287085/

相关文章:

python - Python 中 PytagCloud 的困惑且无法解释的输出

graphviz - 固定节点位置

python - Pod错误-Fastparquet的建筑轮子失败

python - 如何检查dask数据框是否为空

python - 溢出 : length too large

python - 为什么与多个 Popen 子进程一起使用时会发生通信死锁?

javascript - Python 将 JavascriptSerializer 转换为日期时间?

graph - 边用 Graphviz 和 Dot 指向边

图形可视化/点 : can the distance between two nodes be set individually?

python - MemoryError 将两个数据帧与 pandas 和 dasks 合并——我该怎么做?