Search code examples
graphvizsnakemake

Could not load lib/graphviz/libgvplugin_pango.so.6 - file not found when trying to make a --rulegraph of a snakemakefile


I tried to make a pdf file for my snakemake file with:

snakemake --forceall --snakefile snakefile.smk --rulegraph | dot -Tpdf > dag.pdf

But it gives an error:

Warning: Could not load "../lib/graphviz/libgvplugin_pango.so.6" - file not found
Warning: Could not load "../lib/graphviz/libgvplugin_pango.so.6" - file not found
Format: "pdf" not recognized. Use one of: canon cmap cmapx cmapx_np dot dot_json eps fig gv imap imap_np ismap json json0 mp pdf pic plain plain-ext png pov ps ps2 svg svgz tk vml vmlz xdot xdot1.2 xdot1.4 xdot_json
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

I Tried reinstalling the graphviz package but still I get the same error. When installing graphviz into a conda environment, the environment cant find the library libgvplugin_pango.so.6


Solution

  • So I posted this because my goal was not really to fix the whole program just enough so I could get my graph of the Snakemake pipeline. So I found out that the svg functions did indeed work. So if your goal is just to get a visualisation of the pipeline you can use the following code:

    snakemake --forceall --snakefile snakefile.smk --rulegraph | dot -Tsvg > dag.svg

    Thank you for you attention. Have a good day :).