Fork me on CSDN

ImportError: ('Failed to import pydot. You must `pip install pydot` and install graphviz (https://graphviz.gitlab.io/download/), ', 'for `pydotprint` to work.')

错误提示:

 

 修正:

#装包
pip install pydot pip install pydotplus pip install graphviz

点击提示网址:https://graphviz.gitlab.io/download/

 

 下载后双击运行,安装后找到子文件夹bin目录地址(我这里是C:\Program Files\Graphviz\bin)

 

 添加以下代码:

import os
os.environ['PATH'] += os.pathsep + r'C:\Program Files\Graphviz\bin'

再次运行代码,成功

 

posted @ 2021-07-26 19:47  追风赶月的少年  阅读(1103)  评论(0编辑  收藏  举报