I've now managed to resolve this. Was due to multiple libgvc versions
present in the system.
My solution, which unfortunately isn't elegant, was to hardcode the
library name into draw/__init__.py instead of using
ctypes.util.find_library.
The problem with find_library is that it doesn't consult
LD_LIBRARY_PATH, making the search algorithm rather inflexible.

libgv = ctypes.CDLL("libgvc.so.6.0.0")
#    libname = ctypes.util.find_library("gvc")
#    if libname is None:
#        raise OSError()
#    libgv = ctypes.CDLL(libname)

Best,
Mikhail


On Sun, Apr 8, 2012 at 2:57 PM, Mikhail Spivakov <[email protected]> wrote:
> PS. Sorry for an inconsistent example!
> In fact, both of these work:
>
> $ dot -Tpng test1.dot -o graph1.png
> $ dot -Tpdf test1.dot -o graph1.pdf
>
> while none of those do:
>
> graph_draw(ug, vprops={"label": ug.vertex_index},
> output="two-nodes.png", layout="fdp")
> graph_draw(ug, vprops={"label": ug.vertex_index},
> output="two-nodes.pdf", layout="fdp")
>
> so it's not format-dependent.
>
> Many thanks,
> Mikhail
>
>
> On Sun, Apr 8, 2012 at 5:52 PM, Mikhail Spivakov <[email protected]> wrote:
>> Hello!
>>
>> I've got graphviz installed with python and python27 bindings.
>> However, when I do:
>>
>> graph_draw(ug, vprops={"label": ug.vertex_index},
>> output="two-nodes.pdf", layout="fdp")
>>
>> I get the following error:
>>
>> graph G {
>>        graph [outputorder=edgesfirst, mode=major, overlap=true, ratio=fill,
>> size="5.905512,5.905512", start=3019255687130444316];
>>        node [label="\N", shape=circle, width="0.105", height="0.105",
>> style=filled, color="#2e3436", fillcolor="#a40000"];
>>        edge [arrowsize="0.3", color="#2e3436", penwidth="1.0"];
>>        graph [bb="0,0,425,425"];
>>        0 [label=0, width="0.47", height="0.47", pos="330,101"];
>>        1 [label=1, width="0.47", height="0.47", pos="93,324"];
>>        0 -- 1 [pos="318,113 277,152 147,274 106,312"];
>> }
>> Error: renderer for pdf is unavailable
>> Out[8]: <PropertyMap object with key type 'Vertex' and value type
>> 'vector<double>', for Graph 0x5ff3f90, at 0x6001290>
>>
>> At the same time, if I save the above dot expression as test1.dot and
>> run the following command from the command line:
>>
>> $ dot -Tpng test1.dot -o graph1.png
>>
>> I get a beautiful graph1.png.
>>
>> Graphviz is installed in a non-standard location as I don't have admin
>> rights. However, the graphviz folder is in LD_LIBRARY_PATH and gv.py
>> is in PYTHONPATH.
>> Would very much appreciate your advice on what else graph-tool might
>> need to find the libraries and/or how to test it better.
>>
>> Many thanks,
>> Mikhail
_______________________________________________
graph-tool mailing list
[email protected]
http://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to