例外:“点"在Mac上的python中的路径中找不到 [英] Exception: "dot" not found in path in python on mac

查看:226
本文介绍了例外:“点"在Mac上的python中的路径中找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Mac上使用caffe.draw通过anaconda python绘制caffe网.但是我得到了这样的错误:

I want to use caffe.draw to draw the caffe net by anaconda python on mac. But I got the error like this:

File "python/draw_net.py", line 45, in <module>
    main()
  File "python/draw_net.py", line 41, in main
    caffe.draw.draw_net_to_file(net, args.output_image_file, args.rankdir)
  File "/Users/xxh/caffe/distribute/python/caffe/draw.py", line 222, in draw_net_to_file
    fid.write(draw_net(caffe_net, rankdir, ext))
  File "/Users/xxh/caffe/distribute/python/caffe/draw.py", line 204, in draw_net
    return get_pydot_graph(caffe_net, rankdir).create(format=ext)
  File "/Users/xxh/anaconda2/lib/python2.7/site-packages/pydot.py", line 1883, in create
    prog=prog))
Exception: "dot" not found in path.

我已经安装了pydot和graphviz,如何将点的路径添加到python路径?

I have installed pydot and graphviz ,and how can I add the dot's path to python path?

推荐答案

如果仍然出现错误,我想您已使用pip安装了pydot和graphviz. 请使用:

If you are still getting the error, I suppose you installed pydot and graphviz using pip. Please use :

  • sudo apt-get install graphviz
  • pip安装pydot

如果这给您权限问题,请使用:

If this gives you permission issues please use:

  • sudo pip安装pydot

这将从Ubuntu安装完整的graphviz.

This will install the complete graphviz from Ubuntu.

之后,draw_net.py正确运行.

After this the draw_net.py runs correctly.

这篇关于例外:“点"在Mac上的python中的路径中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆