Locating Graphviz install on Windows (easy_install and/or svn install)

3,090 views
Skip to first unread message

ChrisWJ

unread,
Nov 19, 2008, 12:45:08 PM11/19/08
to pygraphviz-discuss
I am trying to use easy_install, but I cannot install pygraphviz
because it is complaining about not finding graphviz.
I have graphviz 2.21 vanilla Windows install (path: C:\Program Files
\Graphviz 2.21)

Then, in order to specify the library_path and include_path
explicitly, I downloaded from svn and changed setup.py values to:
library_path=C:\Program Files\Graphviz 2.21\lib
include_path=C:\Program Files\Graphviz 2.21\include
and I have tried:
include_path=C:\Program Files\Graphviz 2.21\include\graphviz

When it tries to build (using msvc), I get
pygraphviz/graphviz_wrap.c(2487) : fatal error C1083: Cannot open
include file:
'agraph.h': No such file or directory
error: command 'cl.exe' failed with exit status 2

How do I go about using pygraphviz? How can I set it up so that it
recognizes my graphviz install.

Aric Hagberg

unread,
Nov 19, 2008, 1:31:23 PM11/19/08
to pygraphvi...@googlegroups.com

The error appears to be in searching for agraph.h - one of the Graphviz
header files. Is agraph.h in :\Program Files\Graphviz 2.21\include ?

I'm don't have access to any Windows machines for testing so if
anyone has done this successfully I'd like to know. I'd be happy
to adjust the setup.py to make this easier to build.

Aric

ChrisWJ

unread,
Nov 20, 2008, 4:46:38 PM11/20/08
to pygraphviz-discuss
For some reason, that file is not included in the include folder in
the Windows installation.

I would rather be on Linux right now myself, but I have no choice.

Aric Hagberg

unread,
Nov 20, 2008, 6:37:56 PM11/20/08
to pygraphvi...@googlegroups.com
On Thu, Nov 20, 2008 at 01:46:38PM -0800, ChrisWJ wrote:
>
> For some reason, that file is not included in the include folder in
> the Windows installation.

I suppose then that your installation isn't complete?
Are those files not included in the Windows installer?
If you have libagraph you might be able to get by with
just getting the few .h files you need (agraph.h and the
ones included from there).

Aric

ChrisWJ

unread,
Nov 21, 2008, 3:30:54 PM11/21/08
to pygraphviz-discuss
I used cygwin and the ls command to generate a list of the files in
the installation folder. This was a default windows Graphviz install.
I shortened some sections by replacing the file contents with "..."

$ ls -R Graphviz\ 2.21/
Graphviz 2.21/:
bin etc include lib share

Graphviz 2.21/bin:
GVUI.exe fc-cat.exe lefty.exe
libgvplugin_dot_layout-5.dll neato.exe
GVedit.exe fc-list.exe libcairo-2.dll
libgvplugin_gd-5.dll nop.exe
acyclic.exe fc-match.exe libcdt-4.dll
libgvplugin_neato_layout-5.dll props.txt
bcomps.exe fdp.exe libcgraph-4.dll
libgvplugin_pango-5.dll prune.exe
ccomps.exe gc.exe libexpat.dll
libltdl-3.dll sccmap.exe
circo.exe gv2gxl.exe libfontconfig-1.dll
libpango-1.0-0.dll settings.ini
comdlg32.ocx gvcolor.exe libfreetype-6.dll
libpangocairo-1.0-0.dll tred.exe
config gvpack.exe libgdk_pixbuf-2.0-0.dll
libpangoft2-1.0-0.dll twopi.exe
diffimg.exe gvpr.exe libglib-2.0-0.dll
libpangowin32-1.0-0.dll unflatten.exe
dijkstra.exe gxl2dot.exe libgmodule-2.0-0.dll
libpathplan-4.dll zlib1.dll
dot.exe gxl2gv.exe libgobject-2.0-0.dll libpng12.dll
dot2gxl.exe iconv.dll libgraph-4.dll libxml2.dll
dotty.exe intl.dll libgvc-4.dll lneato.exe
fc-cache.exe jpeg62.dll libgvplugin_core-5.dll mm2gv.exe

Graphviz 2.21/etc:
fonts gtk-2.0 pango
Graphviz 2.21/etc/fonts:
...
Graphviz 2.21/etc/fonts/conf.avail:
...
Graphviz 2.21/etc/fonts/conf.d:
...
Graphviz 2.21/etc/gtk-2.0:
...
Graphviz 2.21/etc/pango:
...

Graphviz 2.21/include:
graphviz ltdl.h

Graphviz 2.21/include/graphviz:
arith.h geom.h gvcjob.h
gvplugin_render.h textpara.h
cdt.h graph.h gvcommon.h
gvplugin_textlayout.h types.h
cgraph.h gv.cpp gvplugin.h
no_demand_loading.c usershape.h
color.h gv.i gvplugin_device.h pack.h
demand_loading.c gvc.h gvplugin_layout.h pathgeom.h
dot_builtins.c gvcext.h gvplugin_loadimage.h pathplan.h

Graphviz 2.21/lib:
lefty libgvc.dll.a
libgvplugin_gd.la libpathplan.dll.a
libcdt.dll.a libgvc.la
libgvplugin_neato_layout.dll.a libpathplan.la
libcdt.la libgvplugin_core.dll.a
libgvplugin_neato_layout.la pango
libcgraph.dll.a libgvplugin_core.la
libgvplugin_pango.dll.a pkgconfig
libcgraph.la libgvplugin_dot_layout.dll.a libgvplugin_pango.la
libgraph.dll.a libgvplugin_dot_layout.la libltdl.dll.a
libgraph.la libgvplugin_gd.dll.a libltdl.la

Graphviz 2.21/lib/lefty:
...
Graphviz 2.21/lib/pango:
1.6.0
Graphviz 2.21/lib/pango/1.6.0:
modules

Graphviz 2.21/lib/pango/1.6.0/modules:
pango-arabic-fc.dll pango-basic-win32.dll pango-indic-fc.dll
pango-syriac-fc.dll
pango-arabic-lang.dll pango-hangul-fc.dll pango-indic-lang.dll
pango-thai-fc.dll
pango-basic-fc.dll pango-hebrew-fc.dll pango-khmer-fc.dll
pango-tibetan-fc.dll

Graphviz 2.21/lib/pkgconfig:
...
Graphviz 2.21/share:
graphviz license.rtf man setuplogo.bmp
Graphviz 2.21/share/graphviz:
doc graphs lefty
Graphviz 2.21/share/graphviz/doc:
AUTHORS ChangeLog NEWS cpl1.0.txt
html pdf
COPYING Dot.ref addingLayout.txt fontfaq.txt
latex_suggestions.txt
Graphviz 2.21/share/graphviz/doc/html:
FAQ.html build.html gd.html index.html info pspdf.png
winbuild.html
Graphviz 2.21/share/graphviz/doc/html/info:
...
Graphviz 2.21/share/graphviz/doc/pdf:
...
Graphviz 2.21/share/graphviz/graphs:
directed undirected
Graphviz 2.21/share/graphviz/graphs/directed:
...
Graphviz 2.21/share/graphviz/graphs/undirected:
...
Graphviz 2.21/share/graphviz/lefty:
...
Graphviz 2.21/share/man:
man1 man3 man7
Graphviz 2.21/share/man/man1:
...
Graphviz 2.21/share/man/man3:
...
Graphviz 2.21/share/man/man7:
...

Aric Hagberg

unread,
Nov 21, 2008, 7:05:02 PM11/21/08
to pygraphvi...@googlegroups.com
On Fri, Nov 21, 2008 at 12:30:54PM -0800, ChrisWJ wrote:
>
> I used cygwin and the ls command to generate a list of the files in
> the installation folder. This was a default windows Graphviz install.
> I shortened some sections by replacing the file contents with "..."
>
> $ ls -R Graphviz\ 2.21/
> Graphviz 2.21/:

I think I figured it out. Graphviz dropped support for the libagraph
in the latest release (2.21). So you'll need to get 2.20 or older
and I'll have to figure out if and how I can use libcgraph instead.

Aric

ChrisWJ

unread,
Nov 22, 2008, 10:01:19 AM11/22/08
to pygraphviz-discuss
Gotcha, thanks. I'll try again with version 2.20. Seems like that
should have been a bigger Graphviz version change than just 2.20 to
2.21. That's more like a 2.30 move; especially since it breaks the API
used to call the libraries.

Aric Hagberg

unread,
Nov 22, 2008, 10:39:52 AM11/22/08
to pygraphvi...@googlegroups.com
On Sat, Nov 22, 2008 at 07:01:19AM -0800, ChrisWJ wrote:
>
> Gotcha, thanks. I'll try again with version 2.20. Seems like that
> should have been a bigger Graphviz version change than just 2.20 to
> 2.21. That's more like a 2.30 move; especially since it breaks the API
> used to call the libraries.

I guess we were warned (I looked in the ChangeLog).
I just don't follow the graphviz development that closely.

I almost have everything working with "libgraph".
But not with version 2.21 where I get crashes with a bus error
that I haven't figured out yet. Also the subgraph handling
seems to produce different (incorrect?) results.

I'll update here when I get it all working.

Aric

ChrisWJ

unread,
Nov 23, 2008, 2:58:53 PM11/23/08
to pygraphviz-discuss
Great thanks. Your efforts are appreciated.

ChrisWJ

unread,
Dec 23, 2008, 1:51:16 PM12/23/08
to pygraphviz-discuss
I've had some success compiling the latest pygraphviz with mingw on
windows (linking and building with the latest stable version of
Graphviz), which is awesome and an improvement. Unfortunately,
whenever I go to use some of the functions, python crashes.

The simple example from here:
https://networkx.lanl.gov/trac/browser/pygraphviz/trunk//examples/simple.py
will cause a crash.

VS Debugger tells me: "Unhandled exception at 0x7c91b1fa in
python.exe: 0xC0000005: Access violation writing location 0x00000010."

By the way, way to go with compiling against the new cgraph.h.

-Chris

Aric Hagberg

unread,
Dec 26, 2008, 11:10:20 AM12/26/08
to pygraphvi...@googlegroups.com
On Tue, Dec 23, 2008 at 10:51:16AM -0800, ChrisWJ wrote:
>
> I've had some success compiling the latest pygraphviz with mingw on
> windows (linking and building with the latest stable version of
> Graphviz), which is awesome and an improvement. Unfortunately,
> whenever I go to use some of the functions, python crashes.
>
> The simple example from here:
> https://networkx.lanl.gov/trac/browser/pygraphviz/trunk//examples/simple.py
> will cause a crash.
>
> VS Debugger tells me: "Unhandled exception at 0x7c91b1fa in
> python.exe: 0xC0000005: Access violation writing location 0x00000010."

This does work with Linux and OSX so I'm guessing either something
is miscompiled or there is a bug in the Pygraphviz interface that
shows up with mingw.

Do the basic Graphiviz functions work (e.g. dot)? Also you might try
compiling the Graphviz C example in the cgraph man page to see if that
works for you.

Aric

ChrisWJ

unread,
Dec 27, 2008, 11:56:46 AM12/27/08
to pygraphviz-discuss
I am trying to see if a full cygwin with python 2.5 install will work.
Although, I am getting stuck compiling graphviz. I will report back
with status soon. I have been using the dot.exe graphviz executable
with no issues, but I will still attempt to compile and run the simple
C example as well.

-Chris

On Dec 26, 11:10 am, Aric Hagberg <hagb...@lanl.gov> wrote:
> On Tue, Dec 23, 2008 at 10:51:16AM -0800, ChrisWJ wrote:
>
> > I've had some success compiling the latest pygraphviz with mingw on
> > windows (linking and building with the latest stable version of
> > Graphviz), which is awesome and an improvement. Unfortunately,
> > whenever I go to use some of the functions, python crashes.
>
> > The simple example from here:
> >https://networkx.lanl.gov/trac/browser/pygraphviz/trunk//examples/sim...

ChrisWJ

unread,
Dec 28, 2008, 5:07:30 PM12/28/08
to pygraphviz-discuss
Still trying to compile Graphviz through Cygwin because the version in
Cygwin Ports is not compiled with png output (not sure why). I keep
getting stuck with certain parts of the compilation (mostly getting
libs and configure options set right). I will further test with the
compiled Cygwin Ports version and output in other formats to make sure
they work.

If this takes much longer, I may just have to continue to output
in .dot files and call (popen()) the dot executable to produce the
output necessary.

David Martin

unread,
Feb 25, 2015, 9:51:34 AM2/25/15
to pygraphvi...@googlegroups.com
Hi! Maybe i'm late, but for future users coming here:

I solved it by setting correctly the path of graphviz in windows (and downloading the development last snapshot):

include_dirs = 'C:/graphviz/include'
library_dirs = 'C:/graphviz/lib/release/lib'

Using / slashbars instead of windows default \

Greetings!

23103...@qq.com

unread,
Apr 11, 2015, 10:56:41 PM4/11/15
to pygraphvi...@googlegroups.com
Hi man,your answer is cool,  notice that you should use  include_dirs = 'C:/graphviz/include'  rather than 'C:/graphviz/include/graphviz'.
because the graphviz_wrap.c file uses "graphviz/cgraph.h" as its head file.
but when this problem solved, some other problems occur:
  
library_dirs=C:/Program Files/Graphviz2.38/lib/release/lib
include_dirs=C:/Program Files/Graphviz2.38/include
running install
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
3 /GS- /DNDEBUG -DGVDLL "-IC:/Program Files/Graphviz2.38/include" -IC:\Python33\
include -IC:\Python33\include /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win32-
3.3\Release\pygraphviz/graphviz_wrap.obj
graphviz_wrap.c
pygraphviz/graphviz_wrap.c(3321) : warning C4047: 'return' : 'int' differs in le
vels of indirection from 'Agsym_t *'
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCRE
MENTAL:NO "/LIBPATH:C:/Program Files/Graphviz2.38/lib/release/lib" /LIBPATH:C:\P
ython33\libs /LIBPATH:C:\Python33\PCbuild cgraph.lib cdt.lib /EXPORT:PyInit__gra
phviz build\temp.win32-3.3\Release\pygraphviz/graphviz_wrap.obj /OUT:build\lib.w
in32-3.3\pygraphviz\_graphviz.pyd /IMPLIB:build\temp.win32-3.3\Release\pygraphvi
z\_graphviz.lib /MANIFESTFILE:build\temp.win32-3.3\Release\pygraphviz\_graphviz.
pyd.manifest
   Creating library build\temp.win32-3.3\Release\pygraphviz\_graphviz.lib and ob
ject build\temp.win32-3.3\Release\pygraphviz\_graphviz.exp
graphviz_wrap.obj : error LNK2019: unresolved external symbol _PyIOBase_Type ref
erenced in function __wrap_agread
build\lib.win32-3.3\pygraphviz\_graphviz.pyd : fatal error LNK1120: 1 unresolved
 externals
error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"'
failed with exit status 1120

I use python3.3 and graphviz2.38 and pygraphviz1.3rc2 and OS is win32



+8下午10:51:34,David Martin写道:
Reply all
Reply to author
Forward
0 new messages