当我尝试导入dask.dot
无法找到graphviz安装时,我收到了错误消息。但是,安装了graphviz和pygraphviz。
balter@exalab3:~$ conda install dask
Fetching package metadata ...........
Solving package specifications: ..........
# All requested packages already installed.
# packages in environment at /home/.../miniconda3:
#
dask 0.13.0 py35_0 conda-forge
balter@exalab3:~$ python
Python 3.5.3 | packaged by conda-forge | (default, Jan 23 2017, 19:01:48)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dask.dot
Traceback (most recent call last):
File "/home/.../miniconda3/lib/python3.5/site-packages/dask/utils.py", line 63, in import_required
return import_module(mod_name)
File "/home/.../miniconda3/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'graphviz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/.../miniconda3/lib/python3.5/site-packages/dask/dot.py", line 11, in <module>
graphviz = import_required("graphviz", "Drawing dask graphs requires the "
File "/home/.../miniconda3/lib/python3.5/site-packages/dask/utils.py", line 65, in import_required
raise RuntimeError(error_msg)
RuntimeError: Drawing dask graphs requires the `graphviz` python library and the `graphviz` system library to be installed.
>>>
balter@exalab3:~$ conda install graphviz
Fetching package metadata ...........
Solving package specifications: ..........
# All requested packages already installed.
# packages in environment at /home/.../miniconda3:
#
graphviz 2.38.0 4 bioconda
如何解决此问题?
答案 0 :(得分:11)
MRocklin的答案中引用的github问题得到了更新。 我用以下几行解决了这个问题:
conda install -c conda-forge graphviz
conda install -c conda-forge python-graphviz
此评论解释了此https://github.com/ContinuumIO/anaconda-issues/issues/485#issuecomment-279296254
conda list输出:
漂白剂1.5.0 py35_0
散景0.12.5 py35_0
bzip2 1.0.6 vc14_3 [vc14]
胸部0.2.3 py35_0
点击6.7 py35_0
cloudpickle 0.2.2 py35_0
colorama 0.3.9 py35_0 conda-forge
cycler 0.10.0 py35_0
cython 0.25.2 py35_1 conda-forge
dask 0.14.1 py35_0
装饰者4.0.11 py35_0
分发1.16.1 py35_0
入口点0.2.2 py35_1
fastparquet 0.0.5 py35_1 conda-forge
freetype 2.5.5 vc14_2 [vc14]
graphviz 2.38.0 4 conda-forge
h5py 2.7.0 np112py35_0
hdf5 1.8.15.1 vc14_4 [vc14]
heapdict 1.0.0 py35_1
html5lib 0.999 py35_0
icu 57.1 vc14_0 [vc14]
ipykernel 4.6.1 py35_0
ipython 6.0.0 py35_0
ipython_genutils 0.2.0 py35_0
ipywidgets 6.0.0 py35_0
jinja2 2.9.6 py35_0
jpeg 9b vc14_0 [vc14]
jsonschema 2.6.0 py35_0
jupyter 1.0.0 py35_3
jupyter_client 5.0.1 py35_0
jupyter_console 5.1.0 py35_0
jupyter_core 4.3.0 py35_0
libpng 1.6.27 vc14_0 [vc14]
libtiff 4.0.6 vc14_3 [vc14]
llvmlite 0.17.0 py35_0
小盒子0.2.0 py35_1
markupsafe 0.23 py35_2
matplotlib 2.0.0 np112py35_0
迷雾0.7.4 py35_0
mkl 2017.0.1 0
msgpack-python 0.4.8 py35_0
nbconvert 5.1.1 py35_0
nbformat 4.3.0 py35_0
笔记本5.0.0 py35_0
numba 0.32.0 np112py35_0
numexpr 2.6.2 np112py35_0
numpy 1.12.1 py35_0
olefile 0.44 py35_0
openssl 1.0.2k vc14_0 [vc14]
大熊猫0.19.2 np112py35_1
pandocfilters 1.4.1 py35_0
分手0.3.7 py35_0
path.py 10.3.1 py35_0
pickleshare 0.7.4 py35_0
枕头4.1.0 py35_0
点9.0.1 py35_1
ply 3.9 py35_0 conda-forge
prompt_toolkit 1.0.14 py35_0
psutil 5.2.2 py35_0
py 1.4.33 py35_0 conda-forge
pygments 2.2.0 py35_0
pyparsing 2.1.4 py35_0
pyqt 5.6.0 py35_2
pytables 3.2.2 np112py35_4
pytest 3.0.7 py35_0 conda-forge
python 3.5.3 0
python-dateutil 2.6.0 py35_0
python-graphviz 0.6 py35_1 conda-forge
pytz 2017.2 py35_0
pyyaml 3.12 py35_0
pyzmq 16.0.2 py35_0
qt 5.6.2 vc14_3 [vc14]
qtconsole 4.3.0 py35_0
请求2.13.0 py35_0
scipy 0.19.0 np112py35_0
setuptools 27.2.0 py35_1
simplegeneric 0.8.1 py35_1
啜饮4.18 py35_0
六个1.10.0 py35_0
sortedcollections 0.5.3 py35_0
sortedcontainers 1.5.7 py35_0
tblib 1.3.2 py35_0
testpath 0.3 py35_0
thriftpy 0.3.9 py35_0 conda-forge
tk 8.5.18 vc14_0 [vc14]
toolz 0.8.2 py35_0
龙卷风4.4.2 py35_0
traitlets 4.3.2 py35_0
vs2015_runtime 14.0.25123 0
wcwidth 0.1.7 py35_0
车轮0.29.0 py35_0
widgetsnbextension 2.0.0 py35_0
win_unicode_console 0.5 py35_0
zict 0.1.1 py35_0
zlib 1.2.8 vc14_3 [vc14]
答案 1 :(得分:1)
我建议避免使用conda graphviz
包。请参阅此处的讨论:https://github.com/ContinuumIO/anaconda-issues/issues/485
使用您的系统安装程序(brew,apt-get或下载Windows安装程序)安装graphviz,然后在安装系统库后安装graphviz包。
答案 2 :(得分:1)
Dask documentation已针对graphviz安装问题进行了更新:
您必须同时安装graphviz系统库(使用类似工具 apt-get,yum或brew)和graphviz Python库。如果您使用 Conda然后您需要安装python-graphviz,它将随身携带 graphviz系统库作为依赖项。
如下所述,将同时安装python和系统graphviz库:
conda install -c anaconda python-graphviz