在使用LightGBM進行可視化時,用到了Graphviz包,在安裝Graphviz包時遇到了以下問題。
錯誤描述:
ExecutableNotFound: failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH
錯誤原因分析:
起初以為原因是未安裝graphviz模塊,使用pip install graphviz 之后,發現還是不行,后來用 pip uninstall graphviz 卸載之后重新安裝還是不行。
最后才發現需要先安裝graphviz程序。
說明一下,graphviz這個包,使用pip install graphviz 安裝后,這只安裝了graphviz的pyhon調用接口,使用的話還需要下載graphviz的安裝文件。
解決方案:
mac 上可以使用以下命令安裝graphviz包
————————————————
參考:
https://blog.csdn.net/qq_32731311/article/details/115578820
https://graphviz.org/download/#mac