I followed the installation instructions but when I do:>>> import pygraphviz
I get an error like:
ImportError: libagraph.so.1: cannot open shared object file: No such file or directory
What is wrong?
Some Unix systems don’t include the Graphviz library in the default search path for the run-time linker. The path is often something like
/sw/lib/graphvizetc. and it needs to be added to your search path. On *nix systems, the preferred way to do this is by setting the appropriate flags when building/installing
pygraphviz. For example, if the Graphviz libraries are installed in
/opt/lib/mygviz/on your system:pip install --global-option=build_ext \ --global-option="-L/opt/lib/mygviz/" \ --global-option="-R/opt/lib/mygviz/" \ pygraphviz
In this example, the
-Rflags tell the linker where to look for the required Graphviz libraries at build time and run time, respectively.
How do I compile pygraphviz under Windows?
See Windows for the latest on how to install Graphviz and pygraphviz on Windows.
Why don’t you distribute a pygraphviz Windows installer?
We would very much like to make binary wheels available for
pygraphviz, but there are several complications.
pygraphvizis a wrapper around Graphviz, which means that Graphviz must be installed, and Graphviz header files, libraries and command line executables must all be accessible for the wrapper. The recommended use of the Graphviz CLI poses challenges for wheel packaging.
This GitHub issue for further discussion on wheels and packaging.