首页 > 系统相关 >Ubuntu系统下python模块graphviz运行报错:graphviz.backend.execute.ExecutableNotFound: failed to execute PosixPa

Ubuntu系统下python模块graphviz运行报错:graphviz.backend.execute.ExecutableNotFound: failed to execute PosixPa

时间:2023-05-13 12:23:29浏览次数:59  
标签:execute py graphviz 报错 File home line

代码中需要运行python模块graphviz,安装:

pip install graphviz

 

运行后报错:

graphviz.backend.execute.ExecutableNotFound: failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH

 

 

报错的全部信息:

Traceback (most recent call last):
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/site-packages/graphviz/backend/execute.py", line 81, in run_check
    proc = subprocess.run(cmd, **kwargs)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: PosixPath('dot'): PosixPath('dot')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "cartpole.py", line 76, in <module>
    evaluation()
  File "cartpole.py", line 56, in evaluation
    visualize.draw_net(p.config, winner, True, node_names=node_names)
  File "/home/devil/Desktop/neat/visualize.py", line 150, in draw_net
    dot.render(filename, view=view)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/site-packages/graphviz/_tools.py", line 171, in wrapper
    return func(*args, **kwargs)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/site-packages/graphviz/rendering.py", line 122, in render
    rendered = self._render(*args, **kwargs)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/site-packages/graphviz/_tools.py", line 171, in wrapper
    return func(*args, **kwargs)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/site-packages/graphviz/backend/rendering.py", line 327, in render
    capture_output=True)
  File "/home/devil/anaconda3/envs/tmp2/lib/python3.7/site-packages/graphviz/backend/execute.py", line 84, in run_check
    raise ExecutableNotFound(cmd) from e
graphviz.backend.execute.ExecutableNotFound: failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH

 

=========================================

 

解决方法:

sudo apt install graphviz

 

 

PS:

原来是没安装绘图的程序,只安装了python的连接模块。

 

 

参考:

https://blog.csdn.net/iLOVEJohnny/article/details/128825005

 

 

 

==========================================

 

标签:execute,py,graphviz,报错,File,home,line
From: https://www.cnblogs.com/devilmaycry812839668/p/17397102.html

相关文章

  • netty运行测试类时报错:Unrecognized option: --illegal-access=deny
    netty(4.1.42.Final )运行netty-buffer模块测试类时报错:Unrecognizedoption:--illegal-access=deny Unrecognizedoption:--illegal-access=denyError:CouldnotcreatetheJavaVirtualMachine.Error:Afatalexceptionhasoccurred.Programwillexit.解题思路:1、......
  • Vue项目报错: Component name “xxx“ should always be multi-word vue/multi-word-co
    报错的意思是组件名应该始终是多单词,不应该以单个单词命名组件解决办法1:修改组件名称:例如当前的登陆组件名是login.vue修改成LoginName.vue,组件名需要以驼峰式命名至少两个单词,不一定都得是LoginName.vue可以是NameLogin.vue也可以是LoginNiu.vue总之就是以驼峰式命名......
  • vue-element-admin安装依赖报错问题
    前言vue-element-admin中文官网要使用中文版,直接去gitgithub下载包:https://github.com/PanJiaChen/vue-element-admin/tree/i18ngitee下载包:https://gitee.com/panjiachen/vue-element-admin/tree/i18n分支记得选择这个i18n问题解决1.修改package.json文件tui-editor这......
  • oracle报错:ORA-01034错误:oracle not available 播报文章
    1、ORA-01034错误:oraclenotavailable https://jingyan.baidu.com/article/d8072ac4a016c5ec94cefd72.html 首先先先测试一下,监听是否启动:lsnrctlstatus;如果监听没有启动,则如果监听没起lsnrctlstar,监听启动要将近1分钟的时间。 2连接数据库:connect ......
  • vue版本报错
     在引入部分加入@2声明是vue2版本即可   ......
  • 打开PDB报错ORA-30013
    多租户架构,之前还在做运维的时期接触也不多。遇到多租户问题,第一反应是有些发虚的。但实际很多问题很简单,也容易解决。本文就是一个例子。问题:RAC节点2打开所有PDB时,报错ORA-30013。SQL>alterpluggabledatabaseallopen;alterpluggabledatabaseallopen*ERRORatlin......
  • ADG无法切换:报错 ORA-16467
    现象:ADG无法切换:验证时就报错ORA-16467记录问题,顺便展现一次troubleshooting的心路历程。具体查询:在主库操作,@primary切换验证:alterdatabaseswitchovertodemoracverify;报错ORA-16467:SQL>alterdatabaseswitchovertodemoracverify;alterdatabaseswitchov......
  • 关于el-progress percentage的值超100以及处理后端返回小数转换报错的处理
    在开发大屏幕数据项目的时候,在el-table中用el-progress展示效率,由于后端返回的是小数,前端需要把0.555555555展示成50%的格式(不展示小数点后的数字),我刚开始写控制台一直报错,用Number()转化了数值还是在控制台报percentage期望的是‘number’,但是捕抓到的是'String'的错误。最后这......
  • MFC-ShellExecuteEx打开文件
     打开执行程序SHELLEXECUTEINFOShellInfo;/*typedefstruct_SHELLEXECUTEINFO{DWORDcbSize;存储该结构的长度,以字节为单位ULONGfMask;一个标志数组,用来设置其他成员的有效性SEE_MA......
  • 淄博/中原云商有这些报错,但不影响
    1.淄博项目:到第三个报错时,项目就能运行了1)2)3) 2.中原云商 ......