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

前端 未结 27 2728
醉酒成梦
醉酒成梦 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:30

    In Windows, even after installing graphviz-2.38.msi, you can add your own path in pydot.py (found under site-package folder)

     if os.sys.platform == 'win32':
    
        # Try and work out the equivalent of "C:\Program Files" on this
        # machine (might be on drive D:, or in a different language)
        #
    
        if os.environ.has_key('PROGRAMFILES'):
    
            # Note, we could also use the win32api to get this
            # information, but win32api may not be installed.
    
            path = os.path.join(os.environ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin')
    
        else:
    
            #Just in case, try the default...
            path = r"C:\PYTHON27\GraphViz\bin"  # add here.
    

提交回复
热议问题