问题
安装上graphviz和pydot之后调用出现如下问题
['dot', '-Tpng', '/tmp/tmp1KPaiV'] return code: 1
stdout, stderr:
Warning: Could not load "/home/liu/anaconda2/envs/tensorflow/lib/graphviz/libgvplugin_pango.so.6" - file not found
Warning: Could not load "/home/liu/anaconda2/envs/tensorflow/lib/graphviz/libgvplugin_pango.so.6" - file not found
Format: "png" not recognized. Use one of: canon cmap cmapx cmapx_np dot eps fig gv imap imap_np ismap pdf pic plain plain-ext png pov ps ps2 svg svgz tk vml vmlz xdot xdot1.2 xdot1.4
解决方案
其实这里是存在一些依赖关系的,首先我们需要安装graphviz的python接口,然后安装graphviz软件本身,最后安装pydot
在Ubuntu下即:
pip install graphviz
sudo apt-get install graphviz
pip install pydot