python - Graphviz 面临的问题
问题描述
我已经在我的 MacOS 上使用以下命令安装了 graphviz: brew install graphviz 现在它显示我的 graphviz 是最新的。
但是在我的 Jupyter 笔记本上运行以下代码时:
# Extract the small tree
tree_small = regressor1.estimators_[5]
# Save the tree as a png image
export_graphviz(tree_small, out_file = 'tree.dot', feature_names = home_data.columns, rounded = True, precision = 1)
(graph, ) = pydot.graph_from_dot_file('tree.dot')
graph.write_png('tree.png')
它抛出以下错误:
FileNotFoundError:[Errno 2] 在路径中找不到“点”。ExecutableNotFound:未能执行“点”,请确保 Graphviz 可执行文件位于您系统的 PATH*
如果有人可以帮助我,将不胜感激。PS:我是使用 MacOS 的新手,所以我不确定如何在 PATH 中添加点。我尝试做 echo $PATH,它当然不包括 graphviz,但不确定如何检查它的安装位置。
谢谢
解决方案
推荐阅读
- python - cv2.imdecode 解码 base64 时返回 None
- c - UNIX getfs(开发)
- reactjs - 如何使 Material UI 表格中的表格单元格更小?
- hololens - 输入动作和游戏对象焦点
- python - 根据值创建两个 Pandas DataFrame
- excel - Excel宏保留X变量?
- html - IE 宽度 100% 不起作用。如何解决?
- javascript - 如何通过 div 将点击传递到其下方不相关的 div 并触发两个 div 的 onClick 侦听器?
- google-chrome - 本地托管的 HTTPS 站点给出有关 websocket 的 Chrome 错误(使用 ParcelJS 包时)
- node.js - Docker compose 未正确复制文件以运行反应应用程序