Pycharm graphviz.backend.ExecutableNotFound:未能执行[';点';,';-Tpng';],请确保graphviz可执行文件在您的系统上';路径

Pycharm graphviz.backend.ExecutableNotFound:未能执行[';点';,';-Tpng';],请确保graphviz可执行文件在您的系统上';路径,pycharm,ubuntu-16.04,graphviz,dot,Pycharm,Ubuntu 16.04,Graphviz,Dot,有一个小时我没能找到任何解决这个问题的方法,所以我决定最好在这里提问。唯一丰富的信息是没有提供详细的指示,以配合我的情况 我在Windows10上,使用PyCharm连接到离线Ubuntu 16.04服务器,尝试一些机器学习分类 代码工作到一定程度,然后抛出 Traceback (most recent call last): File "/home/user/.local/lib/python3.5/site-packages/graphviz/backend.py", line 159,

有一个小时我没能找到任何解决这个问题的方法,所以我决定最好在这里提问。唯一丰富的信息是没有提供详细的指示,以配合我的情况

我在Windows10上,使用PyCharm连接到离线Ubuntu 16.04服务器,尝试一些机器学习分类

代码工作到一定程度,然后抛出

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.5/site-packages/graphviz/backend.py", line 159, in run
    proc = subprocess.Popen(cmd, startupinfo=get_startupinfo(), **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'dot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/project/2_input/xgboost_loop.py", line 55, in <module>
    xgb.plot_tree(classifier, ax=plt.gca())
  File "/home/user/.local/lib/python3.5/site-packages/xgboost/plotting.py", line 281, in plot_tree
    s.write(g.pipe(format='png'))
  File "/home/user/.local/lib/python3.5/site-packages/graphviz/files.py", line 138, in pipe
    quiet=quiet)
  File "/home/user/.local/lib/python3.5/site-packages/graphviz/backend.py", line 229, in pipe
    out, _ = run(cmd, input=data, capture_output=True, check=True, quiet=quiet)
  File "/home/user/.local/lib/python3.5/site-packages/graphviz/backend.py", line 162, in run
    raise ExecutableNotFound(cmd)
graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpng'], make sure the Graphviz executables are on your systems' PATH

Process finished with exit code 1
回溯(最近一次呼叫最后一次):
文件“/home/user/.local/lib/python3.5/site packages/graphviz/backend.py”,第159行,正在运行
proc=subprocess.Popen(cmd,startupinfo=get_startupinfo(),**kwargs)
文件“/usr/lib/python3.5/subprocess.py”,第947行,在__
恢复信号,启动新会话)
文件“/usr/lib/python3.5/subprocess.py”,第1551行,在执行子进程中
引发子项异常类型(errno\u num、err\u msg)
FileNotFoundError:[Errno 2]没有这样的文件或目录:“dot”
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“/home/user/project/2_input/xgboost_loop.py”,第55行,在
绘图树(分类器,ax=plt.gca())
文件“/home/user/.local/lib/python3.5/site packages/xgboost/plotting.py”,第281行,在绘图树中
s、 写入(g.pipe(format='png'))
文件“/home/user/.local/lib/python3.5/site packages/graphviz/files.py”,第138行,管道中
安静=安静)
管道中的文件“/home/user/.local/lib/python3.5/site packages/graphviz/backend.py”,第229行
输出,运行(cmd,输入=数据,捕获输出=真,检查=真,安静=安静)
文件“/home/user/.local/lib/python3.5/site packages/graphviz/backend.py”,第162行,正在运行
raise ExecutableNotFound(cmd)
graphviz.backend.ExecutableNotFound:未能执行['dot','-Tpng'],请确保graphviz可执行文件位于系统的路径上
进程已完成,退出代码为1
我通过
pip列表检查了Ubuntu服务器上是否有
graphviz
version
0.13.2
。在上面给出的链接中,有人建议将
whereis dot
的输出作为
os.environ[“PATH”]+=os.pathsep+“output”
添加到要运行的文件中,但除了
dot:
之外,没有任何输出


在本地,我还检查了是否有相同的
graphviz
版本
0.13.2

try
sudo-apt-get-install-graphviz
try
sudo-apt-get-install-graphviz
您必须将graphviz二进制文件添加到系统路径变量中。在我的系统上,这是
C:\Program Files\Graphviz 2.44.1\bin\
您必须将Graphviz二进制文件添加到系统路径变量中。在我的系统上,这是
C:\ProgramFiles\Graphviz 2.44.1\bin\