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 (

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:
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
Patch path -
Learn how to apply patch -

(Ref -


Popular Posts