Why is pydot unable to find GraphViz's executables in Windows 8?

前端 未结 27 2670
醉酒成梦
醉酒成梦 2020-11-27 14:26

I have GraphViz 2.32 installed in Windows 8 and have added C:\\Program Files (x86)\\Graphviz2.32\\bin to the System PATH variable. Still pydot is unable to find its executab

27条回答
  •  抹茶落季
    2020-11-27 14:35

    If you dont want to mess around with path variables (e.g. if you are no admin) and if you are working on windows, you can do the following which solved the problem for me.

    Open graphviz.py (likely located in ...Anaconda\pkgs\graphviz***\Library\bin) in an editor. If you cant find it you might be able to open it via the error message.

    Go to the fuction __find_executables and replace:

    elif os.path.exists(os.path.join(path, prg + '.exe')):
       if was_quoted:
          progs[prg] = '"' + os.path.join(path, prg + '.exe') + '"'
       else:
          progs[prg] = os.path.join(path, prg + '.exe')
    

    with

    elif os.path.exists(os.path.join(path, prg + '.bat')):
       if was_quoted:
          progs[prg] = '"' + os.path.join(path, prg + '.bat') + '"'
       else:
          progs[prg] = os.path.join(path, prg + '.bat')
    

提交回复
热议问题