我见过一个Stack Overflow存储库,并且在那里提到首先'pip install GraphViz'然后'pip install pydotplus'。现在我已经成功安装了我的C:\ Users \ ChirantanGupta \ Downloads \ WinPython-64bit -3.6.0.0 \蟒蛇,3.6.0b3.amd64 \ LIB \站点包。两者都存在于那里,但每当我尝试运行此代码时,它都会显示错误: 错误是:
文件“C:\ Users \ ChirantanGupta \ Downloads \ WinPython-64bit-3.6.0.0 \ python-3.6.0b3.amd64 \ lib \ site-packages \ pydotplus \ graphviz.py”,第1918行,写入 fobj.write(self.create(prog,format))
文件“C:\ Users \ ChirantanGupta \ Downloads \ WinPython-64bit-3.6.0.0 \ python-3.6.0b3.amd64 \ lib \ site-packages \ pydotplus \ graphviz.py”,1960年的行,在创建 '未找到GraphViz的可执行文件')
InvocationException:找不到GraphViz的可执行文件
以下是代码:
[Tree('S', [Tree('S', [Tree('V', ['describe']), Tree('NP', [Tree('DT', ['every']), Tree('N', ['step']), Tree('PP', [Tree('P', ['of']), Tree('NP', [Tree('PRP', ['your']), Tree('N', ['work'])])])])]), Tree('CONJ', ['and']), Tree('S', [Tree('V', ['present']), Tree('NP', [Tree('DT', ['all']), Tree('NP', [Tree('ADJ', [Tree('ADJ', ['intermediate']), Tree('CONJ', ['and']), Tree('ADJ', ['final'])]), Tree('N', ['results']), Tree('PP', [Tree('P', ['in']), Tree('NP', [Tree('DT', ['a']), Tree('N', ['Word_Document'])])])])])])])]
答案 0 :(得分:1)
要在WinPython中安装Graphviz:
c:\tools\graphviz
。确保将Graphviz bin
子文件夹添加到您的PATH
环境变量中。按照示例,打开命令提示符窗口,然后键入:
setx PATH=%PATH%;c:\tools\graphviz\bin;
使用graphviz
或WinPython软件包管理器在WinPython中安装pip
软件包(有关更多详细信息,请参见here)。
答案 1 :(得分:0)
也许试试这个: