Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: renderer for julia:cairo is unavailable #11

Closed
pluskid opened this issue Nov 27, 2014 · 10 comments
Closed

Error: renderer for julia:cairo is unavailable #11

pluskid opened this issue Nov 27, 2014 · 10 comments

Comments

@pluskid
Copy link

pluskid commented Nov 27, 2014

I got the following error when trying the example in the front page in an IJulia Notebook

using GraphViz
Graph("""
graph graphname {
     // The label attribute can be used to change the label of a node
     a [label="Foo"];
     // Here, the node shape is changed.
     b [shape=box];
     // These edges both have different line properties
     a -- b -- c [color=blue];
     b -- d [style=dotted];
 }
""")
Error: renderer for julia:cairo is unavailable
`writemime` has no method matching writemime(::Base64Pipe, ::MIME{symbol("image/png")}, ::Nothing)

 in writemime at /Users/chiyuan/.julia/v0.3/GraphViz/src/GraphViz.jl:587
 in base64 at base64.jl:125
 in display_dict at /Users/chiyuan/.julia/v0.3/IJulia/src/execute_request.jl:34
julia> versioninfo()
Julia Version 0.3.3
Commit b24213b* (2014-11-23 20:19 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.3.0)
  CPU: Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

Do I need to install anything externally? I tried with Pkg.checkout but the same error.

@mlubin
Copy link
Contributor

mlubin commented Dec 22, 2014

Also seeing this from juliabox

@mlubin
Copy link
Contributor

mlubin commented Dec 22, 2014

Doing some debugging, it looks like GraphViz.last_surface is nothing. Any ideas @Keno?

@Keno
Copy link
Contributor

Keno commented Dec 22, 2014

This usually happens when GraphViz is built without cairo support.

@pluskid
Copy link
Author

pluskid commented Jun 22, 2015

How to build it WITH cairo support? The Cairo package is already installed.

@Keno
Copy link
Contributor

Keno commented Jun 25, 2015

Depends on how you got the GraphViz binary.

@pluskid
Copy link
Author

pluskid commented Jun 26, 2015

@Keno What if I got it from HomeBrew?

@Keno
Copy link
Contributor

Keno commented Jun 26, 2015

JuliaPackaging/Homebrew.jl#45, should be fixed now though.

@dehann
Copy link

dehann commented Jul 21, 2015

Hi,

I'm having a similar problem but on Ubuntu 14.04, however the same code works on a 12.04 system. The initial indications are writemime and Cairo.jl related. I initially filed an issue there:

JuliaGraphics/Cairo.jl#109 and #18 (sorry for repeated posts).

I'm trying to draw a Graphs.jl with GraphViz.jl -- this works fine on 0.3.8, 0.3.10, 0.4-dev+5933 (12.04) but not 0.4-dev+5933 on 14.04.

julia> GraphViz.Graph(to_dot(g))

Error: renderer for julia:cairo is unavailable

MethodError: writemime has no method matching writemime(::Base.Base64.Base64EncodePipe, ::Base.Multimedia.MIME{symbol("image/png")}, ::Void)
Closest candidates are:
writemime(::IO, !Matched::AbstractString, ::Any)
writemime(::IO, !Matched::Base.Multimedia.MIME{symbol("text/plain")}, ::Any)
writemime(::IO, ::Base.Multimedia.MIME{symbol("image/png")}, !Matched::Cairo.CairoSurface)
...

in writemime at /home/dehann/.julia/v0.4/GraphViz/src/GraphViz.jl:590

More info

I'm working from IJulia notebook and there are 5 packages of interest:

    Cairo 0.2.28
    Gadfly 0.3.13
    GraphViz 0.0.4
    Graphs 0.5.5
    IJulia 0.2.5
julia> versioninfo()
Julia Version 0.4.0-dev+5933
Commit b2528a6 (2015-07-12 17:39 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

thanks,
dehann

@bvdmitri
Copy link

@bvdmitri
Copy link

Can it be reopened? It is easily reproduced with the code from runtests.jl

julia> using GraphViz, Cairo, Test

julia> let g = dot"""
       graph graphname {
            // The label attribute can be used to change the label of a node
            a [label="Foo"];
            // Here, the node shape is changed.
            b [shape=box];
            // These edges both have different line properties
            a -- b -- c [color=blue];
            b -- d [style=dotted];
        }
       """
           @test_nowarn show(IOBuffer(), MIME"image/svg+xml"(), g)
           @test_nowarn show(IOBuffer(), MIME"image/png"(), g)
       end
ERROR: MethodError: no method matching show(::IOBuffer, ::MIME{Symbol("image/png")}, ::Nothing)
The function `show` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  show(::IO, ::MIME{Symbol("image/png")}, ::GraphViz.Graph)
   @ GraphViz ~/.julia/packages/GraphViz/IsUMl/src/cairo.jl:94
  show(::IO, ::MIME{Symbol("image/png")}, ::CairoSurface)
   @ Cairo ~/.julia/packages/Cairo/FQrbN/src/Cairo.jl:459
  show(::IO, ::MIME{Symbol("text/plain")}, ::Any)
   @ Base multimedia.jl:47
  ...

Stacktrace:
 [1] show(io::IOBuffer, m::MIME{Symbol("image/png")}, x::GraphViz.Graph)
   @ GraphViz ~/.julia/packages/GraphViz/IsUMl/src/cairo.jl:98
 [2] #4
   @ ~/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Test/src/Test.jl:924 [inlined]
 [3] (::Base.RedirectStdStream)(thunk::var"#4#8"{GraphViz.Graph}, stream::IOStream)
   @ Base ./stream.jl:1464
 [4] #3
   @ ~/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Test/src/Test.jl:923 [inlined]
 [5] open(::var"#3#7"{GraphViz.Graph}, ::String, ::Vararg{String}; kwargs::@Kwargs{})
   @ Base ./io.jl:410
 [6] open(::Function, ::String, ::String)
   @ Base ./io.jl:407
 [7] macro expansion
   @ ~/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Test/src/Test.jl:922 [inlined]
 [8] top-level scope
   @ REPL[2]:13

julia> versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 11 × Apple M3 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 1 default, 0 interactive, 1 GC (on 5 virtual cores)

julia>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants