Open GoogleCodeExporter opened 9 years ago
Hello,
I have windows 7 32 bit and python 2.7
Here how I installed pydot for python
first I installed GraphViz using this link:
http://www.graphviz.org/content/how-install-graphviz-windows-7-i-cant-find-set-f
ile
after that I installed Pyparsing then pydot (from this answer
http://stackoverflow.com/questions/15951748/pydot-and-graphviz-error-couldnt-imp
ort-dot-parser-loading-of-dot-files-will)
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709
pip install pydot
After that when I tried this line of code:
graph.write_png('test.png')
I had a similar error:
File "c:\app\python\anaconda\1.6.0\lib\site-packages\pydot.py", line 409, in f
ind_graphviz
"SOFTWARE\ATT\Graphviz", 0, win32con.KEY_QUERY_VALUE )
pywintypes.error: (2, 'RegOpenKeyEx', 'The system cannot find the file specified
.')
I solved this problem by changing the function find_graphviz() in the pydot.py
file, here is the code that I used:
def find_graphviz():
if os.sys.platform == 'win32':
if os.environ.has_key('PROGRAMFILES'):
#Change to your path
path = "C:\Program Files\Graphviz2.30\\bin"
else:
#Just in case, try the default...
path = r"C:\Program Files\Graphviz2.30\bin"
progs = __find_executables(path)
if progs is not None :
#print "Used default install location"
return progs
return None
Hope it helps.
Cheers
Original comment by sara.ela...@gmail.com
on 9 Feb 2015 at 5:29
Original issue reported on code.google.com by
jmsa...@gmail.com
on 28 Mar 2014 at 7:30