Jul 21, 2017

Installing pygraphviz on Windows


Install pygraphviz:

1. Install Graphviz (pip install graphviz) (Probably optional)
2. Download pygraphviz or clone using git

pip install pygraphviz

Error - unable to find vcvarsall.bat
1. Install Visual Studio because package has C code that needs Visual C++ compiler. (Probably Optional)
2. Only installing Visual Studio might not work.
Install Visual C++ Build Tools 2015 (http://blog.notfaqs.com/2016/07/python-35-pip-install-error-unable-to.html)

pip install pygraphviz

Error - cannot open include file: 'graphviz/cgraph.h': No such file or directory
Solution -
Set correct path and command line options
pip install --global-option=build_ext --global-option="-IC:\Users\abhishek\pythonPath\pygraphviz-2.38\release\include" --global-option="-LC:\Users\abhishek\pythonPath\pygraphviz-2.38\release\lib" pygraphviz


Error - LINK : fatal error LNK1181: cannot open input file cgraph.lib
Solution - Download win64 binaries for graphviz here: https://github.com/mahkoCosmo/GraphViz_x64/
pip install --global-option=build_ext --global-option="-IC:\Users\abhishek\pythonPath\graphviz-2.38_x64\include" --global-option="-LC:\Users\abhishek\pythonPath\graphviz-2.38_x64\lib" pygraphviz

Error - graphviz_wrap.obj : error LNK2001: unresolved external symbol PyIOBase_Type
Solution - Apply patch
https://stackoverflow.com/questions/42059395/newbie-here-how-do-i-apply-a-patch-to-the-source-of-a-python-package-in-windows
Patch path - https://github.com/Kagami/pygraphviz/commit/fe442dc16accb629c3feaf157af75f67ccabbd6e
Learn how to apply patch - https://www.youtube.com/watch?v=MwbiFAsoACA

(Ref - https://github.com/pygraphviz/pygraphviz/issues/58)
Share:

No comments

Post a Comment

Comment

© Technology Strategy, Architecture, and Development | All rights reserved.
Blogger Template Crafted by pipdig