Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphViz's executables not found on Windows 7 64-bit #65

Closed
GoogleCodeExporter opened this issue Apr 13, 2015 · 20 comments
Closed

GraphViz's executables not found on Windows 7 64-bit #65

GoogleCodeExporter opened this issue Apr 13, 2015 · 20 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Install pydot on Win 7 64
2. Try to run the graph write_png() method

What is the expected output? What do you see instead?

You'll see this:
    graph.write_png('example2_graph.png')
  File "build\bdist.win-amd64\egg\pydot.py", line 1809, in <lambda>
  File "build\bdist.win-amd64\egg\pydot.py", line 1911, in write
  File "build\bdist.win-amd64\egg\pydot.py", line 1953, in create
pydot.InvocationException: GraphViz's executables not found

What version of the product are you using? On what operating system?

Using graphviz 2.28 on Win 7 64-bit.

Please provide any additional information below.

It looks like graphviz uses a different registry setting for Win7 64:

    hkey = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, "SOFTWARE\Wow6432Node\AT&T Research Labs\Graphviz 2.28", 0, win32con.KEY_QUERY_VALUE )


Original issue reported on code.google.com by mike.naq...@gmail.com on 20 Jan 2012 at 4:46

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Adding to the potentialKeys works, but I'm not sure how easy this will be to 
maintain.

            hkey = None
            potentialKeys = [
                "SOFTWARE\\ATT\\Graphviz",
                "SOFTWARE\\AT&T Research Labs\\Graphviz",
                "SOFTWARE\\Wow6432Node\\AT&T Research Labs\\Graphviz 2.28",
            ]


Original comment by mike.naq...@gmail.com on 20 Jan 2012 at 5:15

@GoogleCodeExporter
Copy link
Author

Hi mike.naq,

I am unfamiliar with the inner workings of Python. Where can I find this 
reference to potentialKeys, so I can edit it?

Original comment by edeussil...@gmail.com on 13 Feb 2012 at 9:21

@GoogleCodeExporter
Copy link
Author

Adding the changes in comment 2 to pydot.py solved the problem for me. On my 
computer the pydot.py file is in 
C:\Python27\Lib\site-packages\pydot-1.0.28-py2.7.egg\

Original comment by labo...@gmail.com on 7 May 2012 at 2:38

@GoogleCodeExporter
Copy link
Author

With a bit of luck they will revert to not use the version in the registry key. 
I will add that key to the ones that are checked so pydot will find the 
binaries in this case as well.

Original comment by ero.carr...@gmail.com on 24 Jun 2012 at 6:08

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

I have the same problem using graphviz 2.28 on Win 7 64 bit, and the above 
change to pydot.py did not correct it. Any other ideas about steps to take?

Thanks

Original comment by kfine...@gmail.com on 17 Jul 2012 at 11:46

@GoogleCodeExporter
Copy link
Author

I have run into the same issue. GraphViz 2.28 does not seem to add any keys. I 
have found that Method 2 seems to find the executables just fine, but this does 
not solve my issue. The create definition gives this error: raise 
InvocationException( 'Program terminated with status: %d. stderr follows: %s' % 
(status, stderr_output) ) Any one have any thoughts on this?


Original comment by jos...@gmail.com on 9 Aug 2012 at 8:11

@GoogleCodeExporter
Copy link
Author

I run on win 7 32bit,  GraphViz 2.28, same problem.

Original comment by shiz...@gmail.com on 8 Nov 2012 at 4:11

@GoogleCodeExporter
Copy link
Author

In win 7 32-bit:

            hkey = None
            potentialKeys = [
                "SOFTWARE\\ATT\\Graphviz",
                "SOFTWARE\\AT&T Research Labs\\Graphviz",
                "SOFTWARE\\AT&T Research Labs\\Graphviz 2.28",
            ]

Original comment by shiz...@gmail.com on 8 Nov 2012 at 6:38

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Apr 13, 2015

For anyone who arrives at the same problem on Windows 7 64-bit, I have come up
with another possible fix. Set the GraphViz installation path in pydot.py
explicitly, ala:

for potentialKey in potentialKeys:

    try:
        path = "C:\Program Files (x86)\Graphviz2.30"

        # The regitry variable might exist, left by old installations
        # but with no value, in those cases we keep searching...
        if not path:
            continue

        # Now append the "bin" subdirectory:
        #
        path = os.path.join(path, "bin")
        progs = __find_executables(path)
        if progs is not None :
            #print "Used Windows registry"
            return progs

    except Exception, excp:
        #raise excp
        pass
    else:
        break
  • Note that this has only been tried with Windows 7 Professional 64-Bit with
    PyDot 1.0.28-py2.7 and GraphViz 2.30, however it did allow for successful
    operation of calls to GraphViz from the NetworkX package.

Original comment by apmat...@gmail.com on 24 Feb 2013 at 4:01

@GoogleCodeExporter
Copy link
Author

Method proposed by #10 also works on Windows 7 Professional 32-Bit with PyDot 
1.0.28-py2.7 and GraphViz 2.30.

Original comment by christop...@gmail.com on 10 Apr 2013 at 12:19

@GoogleCodeExporter
Copy link
Author

Same thing happening with Windows7x32 and GraphViz2.30.

There are no entries in the register at all! is there a walk-around for this, 
please?

Original comment by abolot...@gmail.com on 16 Apr 2013 at 12:08

@GoogleCodeExporter
Copy link
Author

I am running Windows 7 64 bit, and spent a long time trying to solve this issue.

What ultimately worked for me was to open pydot.py and search for the 
find_graphviz() function.  I commented out the entirety of the function and 
then wrote:

return __find_executables("C:\\Program Files (x86)\\Graphviz2.32\\bin")

The path indicates where all the executables are for Graphviz.  I have no idea 
if this will work for everyone, but try locating that path and enter it as 
shown into the function and hopefully Graphviz can work for you too!

Original comment by sidere...@gmail.com on 23 Aug 2013 at 12:57

@GoogleCodeExporter
Copy link
Author

Here's a patch that doesn't change existing functionality, but adds a version 
agnostic search for the Windows GraphViz executable.

Original comment by boyet...@gmail.com on 18 Jan 2014 at 7:56

Attachments:

@GoogleCodeExporter
Copy link
Author

Thank you so much for the patch boyettel ! Looks great and will hopefully 
address the problem of finding the binaries in the different versions of 
Windows.

Original comment by ero.carr...@gmail.com on 15 Mar 2014 at 10:59

@GoogleCodeExporter
Copy link
Author

I had the same problem in windows.  Line 534 of pydot.py was trying to import 
the Graphvis excutable by name, (Graphviz 2.28) but I have a different version 
installed.  I replaced this line with my correct location (Graphviz2.36 in my 
case) and it worked.

Original comment by flux07 on 12 Apr 2014 at 7:47

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

I just added this registry key to 64bit win7 and everything started working:

[HKEY_LOCAL_MACHINE\SOFTWARE\ATT\Graphviz]
"InstallPath"="C:\\Program Files (x86)\\Graphviz2.38"

Just change it based on your Graphviz installation directory.

Original comment by amir.tavasoli@gmail.com on 29 Dec 2014 at 6:32

Attachments:

@abhillis
Copy link

abhillis commented Apr 6, 2016

To update GoogleCodeExplorer's April 13th comment above, I found this path now works:

return __find_executables("C:/Program Files (x86)/Graphviz2.38/bin")

@johnyf
Copy link
Contributor

johnyf commented May 14, 2016

Same as #109.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants