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

Cairo and Fontconfig incompatible with Gadfly #1320

Closed
wilburtownsend opened this issue Sep 18, 2019 · 7 comments · Fixed by #1343
Closed

Cairo and Fontconfig incompatible with Gadfly #1320

wilburtownsend opened this issue Sep 18, 2019 · 7 comments · Fixed by #1343

Comments

@wilburtownsend
Copy link

I need to use the Cairo and Fontconfig packages to export to png.
But they seem to be incompatible with Gadfly.

Running this code:

using Gadfly, Cairo, Fontconfig
plot(sin, 0, 6)

causes the error

Error showing value of type Plot:
ERROR: TypeError: in typeassert, expected Compose.PangoLayout, got Nothing

I'm using Julia 1.1.1 with:

  "Fontconfig"       => v"0.2.0"
  "Gadfly"           => v"1.1.0"
  "Cairo"            => v"0.7.0"
@Mattriks
Copy link
Member

What is your OS?
Here are some things to try:

  1. Are you on the master branch of Compose.jl (the graphics package used by Gadfly)? See previous issue. You can get the master branch by doing ]add Compose#master. See the Pkg docs.
  2. Alternatively, you may need to ]add Cairo@0.6 because Compose.jl hasn't been updated to Cairo 0.7
  1. If 1 and 2 fail, try
import Cairo
using Gadfly

without importing or using Fontconfig

@wilburtownsend
Copy link
Author

@Mattriks I'm using OS X 10.14.6.

Thanks -- the third approach you suggested worked. The first didn't seem to do anything. For the second, after running ]add Cairo@0.6, I received a LoadError: Cairo not properly installed. Please run Pkg.build("Cairo")
After running Pkg.build("Cairo"), I received this error.

┌ Error: Error building `Cairo`: 
│ WARNING: redefining constant DEBIAN_VERSION_REGEX
│ WARNING: redefining constant have_sonames
│ WARNING: redefining constant sonames
│ WARNING: redefining constant EXTENSIONS
│ Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespacee1bb1d62184cef8bbbb76e27789171ae::Glib:Class
│ Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespacee1bb1d62184cef8bbbb76e27789171ae::Glib:Class
│ Error: glib: undefined method `uses_from_macos' for Formulary::FormulaNamespacee1bb1d62184cef8bbbb76e27789171ae::Glib:Class
│ [ Info: Attempting to create directory /Users/wtownsend/.julia/packages/Cairo/p68X8/deps/downloads
│ [ Info: Directory /Users/wtownsend/.julia/packages/Cairo/p68X8/deps/downloads already exists
│ [ Info: Downloading file http://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.3.tar.xz
│ [ Info: Done downloading file http://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.3.tar.xz
│ [ Info: Attempting to create directory /Users/wtownsend/.julia/packages/Cairo/p68X8/deps/src
│ [ Info: Directory /Users/wtownsend/.julia/packages/Cairo/p68X8/deps/src already exists
│ [ Info: Attempting to create directory /Users/wtownsend/.julia/packages/Cairo/p68X8/deps
│ [ Info: Directory /Users/wtownsend/.julia/packages/Cairo/p68X8/deps already exists
│ ERROR: LoadError: IOError: could not spawn `unxz -c /Users/wtownsend/.julia/packages/Cairo/p68X8/deps/downloads/glib-2.34.3.tar.xz`: no such file or directory (ENOENT)
│ Stacktrace:
│  [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:400
│  [2] _spawn(::Cmd, ::Array{Any,1}, ::Base.ProcessChain) at ./process.jl:482
│  [3] _spawn(::Base.OrCmds, ::Array{Any,1}, ::Base.ProcessChain) at ./process.jl:450
│  [4] #507 at ./process.jl:421 [inlined]
│  [5] setup_stdios(::getfield(Base, Symbol("##507#508")){Base.OrCmds}, ::Array{Any,1}) at ./process.jl:497
│  [6] _spawn at ./process.jl:420 [inlined]
│  [7] #run#515(::Bool, ::Function, ::Base.OrCmds) at ./process.jl:725
│  [8] run(::Base.OrCmds) at ./process.jl:724
│  [9] run(::BinDeps.PathRule) at /Users/wtownsend/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:503
│  [10] run(::BinDeps.SynchronousStepCollection) at /Users/wtownsend/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521
│  [11] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at ./string:944
│  [12] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at ./string:910
│  [13] satisfy!(::BinDeps.LibraryGroup) at ./string:874
│  [14] top-level scope at string:977
│  [15] include at ./boot.jl:326 [inlined]
│  [16] include_relative(::Module, ::String) at ./loading.jl:1038
│  [17] include(::Module, ::String) at ./sysimg.jl:29
│  [18] include(::String) at ./client.jl:403
│  [19] top-level scope at none:0
│ in expression starting at /Users/wtownsend/.julia/packages/Cairo/p68X8/deps/build.jl:176
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
│ ignored: dlclose()
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075

Beyond me what that means!

@Mattriks
Copy link
Member

If you want to try to go back to Cairo@0.6, you may have to delete the Cairo package directory (~/.julia/packages/Cairo). These are Cairo issues, so test if using Cairo works first. Cairo has recently been updated to Cairo 0.7, and I've opened an issue in Compose (GiovineItalia/Compose.jl#357) to get Compose updated.

@dehann
Copy link

dehann commented Sep 25, 2019

Hi, +1 on similar issue. Ubuntu 18.04, just updated. Pretty sure this is with Cairo, Fontconfig, Gadfly. See below for individual simple tests.

julia> Gadfly.plot(y=randn(100), Geom.path)
Error showing value of type Plot:
ERROR: TypeError: in typeassert, expected Compose.PangoLayout, got Nothing
Stacktrace:
 [1] max_text_extents(::String, ::Float64, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:109
 [2] max_text_extents(::String, ::Measures.Length{:mm,Float64}, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:124
 [3] render(::Gadfly.Guide.HelpScreen, ::Theme, ::Gadfly.Aesthetics) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/guide.jl:76
 [4] render(::Gadfly.Guide.HelpScreen, ::Theme, ::Gadfly.Aesthetics, ::Bool) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/guide.jl:141
 [5] #render_prepared#105(::Bool, ::Bool, ::typeof(Gadfly.render_prepared), ::Plot, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:826
 [6] render_prepared(::Plot, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:806
 [7] render(::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:752
 [8] draw at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:857 [inlined]
 [9] display(::Gadfly.GadflyDisplay, ::MIME{Symbol("text/html")}, ::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:1061
 [10] display(::Gadfly.GadflyDisplay, ::String, ::Any) at ./multimedia.jl:214
 [11] display(::Gadfly.GadflyDisplay, ::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:1018
 [12] display(::Any) at ./multimedia.jl:323
 [13] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [14] invokelatest at ./essentials.jl:789 [inlined]
 [15] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:156
 [16] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:141
 [17] (::getfield(REPL, Symbol("#do_respond#38")){Bool,getfield(Atom, Symbol("##178#179")),REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:718
 [18] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [19] invokelatest at ./essentials.jl:789 [inlined]
 [20] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2306
 [21] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:1038
 [22] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:201
 [23] (::getfield(Base, Symbol("##737#739")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:390
 [24] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [25] invokelatest at ./essentials.jl:789 [inlined]
 [26] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:374
 [27] exec_options(::Base.JLOptions) at ./client.jl:312
 [28] _start() at ./client.jl:464

and

(v1.2) pkg> status
    Status `~/.julia/environments/v1.2/Project.toml`
  [9bbbb610] ApproxManifoldProducts v0.1.0 [`~/.julia/dev/ApproxManifoldProducts`]
  [c52e3926] Atom v0.10.1
  [62eebf14] Caesar v0.4.0 [`~/.julia/dev/Caesar`]
  [159f3aea] Cairo v0.7.0
  [b5cc3c7e] DistributedFactorGraphs v0.3.4 [`~/.julia/dev/DistributedFactorGraphs`]
  [186bb1d3] Fontconfig v0.2.0
  [c91e804a] Gadfly v1.1.0
  [904591bb] IncrementalInference v0.7.6 [`~/.julia/dev/IncrementalInference`]
  [e5e0dc1b] Juno v0.7.2
  [2472808a] KernelDensityEstimate v0.5.1 [`~/.julia/dev/KernelDensityEstimate`]
  [c43967c8] KernelDensityEstimatePlotting v0.1.1 [`~/.julia/dev/KernelDensityEstimatePlotting`]
  [91fb55c2] RoME v0.4.0 [`~/.julia/dev/RoME`]
  [238d586b] RoMEPlotting v0.1.6 [`~/.julia/dev/RoMEPlotting`]

versioninfo

julia> versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 6
  JULIA_EDITOR = atom  -a

Simple Tests (Works)

julia> using Gadfly
julia> plot(y=randn(10), Geom.path)
julia> ^C
julia> using Gadfly, Fontconfig
┌ Warning: Error requiring Fontconfig from Compose:
│ LoadError: UndefVarError: Cairo not defined
│ Stacktrace:
│  [1] top-level scope at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:3
│  [2] include at ./boot.jl:328 [inlined]
│  [3] include_relative(::Module, ::String) at ./loading.jl:1094
│  [4] include at ./Base.jl:31 [inlined]
│  [5] include(::String) at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:1
│  [6] top-level scope at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:176
│  [7] eval at ./boot.jl:330 [inlined]
│  [8] eval at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:1 [inlined]
│  [9] (::getfield(Compose, Symbol("##117#123")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:67
│  [10] err(::getfield(Compose, Symbol("##117#123")), ::Module, ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:38
│  [11] #116 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:66 [inlined]
│  [12] withpath(::getfield(Compose, Symbol("##116#122")), ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:28
│  [13] (::getfield(Compose, Symbol("##115#121")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:65
│  [14] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [15] invokelatest at ./essentials.jl:789 [inlined]
│  [16] #3 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19 [inlined]
│  [17] iterate at ./generator.jl:47 [inlined]
│  [18] _collect(::Array{Function,1}, ::Base.Generator{Array{Function,1},getfield(Requires, Symbol("##3#4"))}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:619
│  [19] map at ./array.jl:548 [inlined]
│  [20] loadpkg(::Base.PkgId) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19
│  [21] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [22] invokelatest at ./essentials.jl:789 [inlined]
│  [23] require(::Base.PkgId) at ./loading.jl:914
│  [24] require(::Module, ::Symbol) at ./loading.jl:906
│  [25] eval(::Module, ::Any) at ./boot.jl:330
│  [26] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
│  [27] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
│  [28] (::getfield(REPL, Symbol("##26#27")){REPL.REPLBackend})() at ./task.jl:268in expression starting at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:3
└ @ Requires ~/.julia/packages/Requires/9Jse8/src/require.jl:40

julia> plot(y=randn(10), Geom.path)
julia> ^C
julia> using Gadfly, Cairo
julia> plot(y=randn(10), Geom.path)
julia> ^C

Combination Doesn't Work

julia> using Gadfly, Cairo, Fontconfig
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf
WARNING: Cairo._jl_libpangocairo is deprecated, use Cairo.libpango instead.
  likely near /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:3
WARNING: Cairo._jl_libpango is deprecated, use Cairo.libpango instead.
  likely near /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:4
WARNING: Cairo._jl_libgobject is deprecated, use Cairo.libgobject instead.
  likely near /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:5
┌ Warning: Error requiring Fontconfig from Compose:
│ ccall: could not find function pango_cairo_font_map_new in library /home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/libpango-1.0.so
│ Stacktrace:
│  [1] link_fontconfig() at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:160
│  [2] top-level scope at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:177
│  [3] eval at ./boot.jl:330 [inlined]
│  [4] eval at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:1 [inlined]
│  [5] (::getfield(Compose, Symbol("##117#123")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:67
│  [6] err(::getfield(Compose, Symbol("##117#123")), ::Module, ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:38
│  [7] #116 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:66 [inlined]
│  [8] withpath(::getfield(Compose, Symbol("##116#122")), ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:28
│  [9] (::getfield(Compose, Symbol("##115#121")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:65
│  [10] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [11] invokelatest at ./essentials.jl:789 [inlined]
│  [12] #3 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19 [inlined]
│  [13] iterate at ./generator.jl:47 [inlined]
│  [14] _collect(::Array{Function,1}, ::Base.Generator{Array{Function,1},getfield(Requires, Symbol("##3#4"))}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:619
│  [15] map at ./array.jl:548 [inlined]
│  [16] loadpkg(::Base.PkgId) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19
│  [17] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [18] invokelatest at ./essentials.jl:789 [inlined]
│  [19] require(::Base.PkgId) at ./loading.jl:914
│  [20] require(::Module, ::Symbol) at ./loading.jl:906
│  [21] eval(::Module, ::Any) at ./boot.jl:330
│  [22] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
│  [23] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
│  [24] (::getfield(REPL, Symbol("##26#27")){REPL.REPLBackend})() at ./task.jl:268
└ @ Requires ~/.julia/packages/Requires/9Jse8/src/require.jl:40

julia> plot(y=randn(10), Geom.path)
Error showing value of type Plot:
ERROR: TypeError: in typeassert, expected Compose.PangoLayout, got Nothing
Stacktrace:
 [1] max_text_extents(::String, ::Float64, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:109
 [2] max_text_extents(::String, ::Measures.Length{:mm,Float64}, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:124
 [3] render(::Gadfly.Guide.HelpScreen, ::Theme, ::Gadfly.Aesthetics) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/guide.jl:76
 [4] render(::Gadfly.Guide.HelpScreen, ::Theme, ::Gadfly.Aesthetics, ::Bool) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/guide.jl:141
 [5] #render_prepared#105(::Bool, ::Bool, ::typeof(Gadfly.render_prepared), ::Plot, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:826
 [6] render_prepared(::Plot, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:806
 [7] render(::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:752
 [8] draw at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:857 [inlined]
 [9] display(::Gadfly.GadflyDisplay, ::MIME{Symbol("text/html")}, ::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:1061
 [10] display(::Gadfly.GadflyDisplay, ::String, ::Any) at ./multimedia.jl:214
 [11] display(::Gadfly.GadflyDisplay, ::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:1018
 [12] display(::Any) at ./multimedia.jl:323
 [13] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [14] invokelatest at ./essentials.jl:789 [inlined]
 [15] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:156
 [16] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:141
 [17] (::getfield(REPL, Symbol("#do_respond#38")){Bool,getfield(REPL, Symbol("##48#57")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:718
 [18] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [19] invokelatest at ./essentials.jl:789 [inlined]
 [20] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2306
 [21] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:1038
 [22] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:201
 [23] (::getfield(Base, Symbol("##737#739")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:390
 [24] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [25] invokelatest at ./essentials.jl:789 [inlined]
 [26] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:374
 [27] exec_options(::Base.JLOptions) at ./client.jl:312
 [28] _start() at ./client.jl:464

Fix 1: add Compose master Doesn't seem to work

(v1.2) pkg> add Compose#master
julia> using Gadfly, Cairo, Fontconfig
[ Info: Recompiling stale cache file /home/dehann/.julia/compiled/v1.2/Gadfly/DvECm.ji for Gadfly [c91e804a-d5a3-530f-b6f0-dfbca275c004]
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf
WARNING: Cairo._jl_libpangocairo is deprecated, use Cairo.libpango instead.
  likely near /home/dehann/.julia/packages/Compose/mwSoa/src/pango.jl:3
WARNING: Cairo._jl_libpango is deprecated, use Cairo.libpango instead.
  likely near /home/dehann/.julia/packages/Compose/mwSoa/src/pango.jl:4
WARNING: Cairo._jl_libgobject is deprecated, use Cairo.libgobject instead.
  likely near /home/dehann/.julia/packages/Compose/mwSoa/src/pango.jl:5
┌ Warning: Error requiring Fontconfig from Compose:
│ ccall: could not find function pango_cairo_font_map_new in library /home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/libpango-1.0.so
│ Stacktrace:
│  [1] link_fontconfig() at /home/dehann/.julia/packages/Compose/mwSoa/src/Compose.jl:160
│  [2] top-level scope at /home/dehann/.julia/packages/Compose/mwSoa/src/Compose.jl:177
│  [3] eval at ./boot.jl:330 [inlined]
│  [4] eval at /home/dehann/.julia/packages/Compose/mwSoa/src/Compose.jl:1 [inlined]
│  [5] (::getfield(Compose, Symbol("##117#123")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:67
│  [6] err(::getfield(Compose, Symbol("##117#123")), ::Module, ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:38
│  [7] #116 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:66 [inlined]
│  [8] withpath(::getfield(Compose, Symbol("##116#122")), ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:28
│  [9] (::getfield(Compose, Symbol("##115#121")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:65
│  [10] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [11] invokelatest at ./essentials.jl:789 [inlined]
│  [12] #3 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19 [inlined]
│  [13] iterate at ./generator.jl:47 [inlined]
│  [14] _collect(::Array{Function,1}, ::Base.Generator{Array{Function,1},getfield(Requires, Symbol("##3#4"))}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:619
│  [15] map at ./array.jl:548 [inlined]
│  [16] loadpkg(::Base.PkgId) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19
│  [17] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [18] invokelatest at ./essentials.jl:789 [inlined]
│  [19] require(::Base.PkgId) at ./loading.jl:914
│  [20] require(::Module, ::Symbol) at ./loading.jl:906
│  [21] eval(::Module, ::Any) at ./boot.jl:330
│  [22] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
│  [23] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
│  [24] (::getfield(REPL, Symbol("##26#27")){REPL.REPLBackend})() at ./task.jl:268
└ @ Requires ~/.julia/packages/Requires/9Jse8/src/require.jl:40

julia> plot(y=randn(10), Geom.path)
Error showing value of type Plot:
ERROR: TypeError: in typeassert, expected Compose.PangoLayout, got Nothing
Stacktrace:
 [1] max_text_extents(::String, ::Float64, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/mwSoa/src/pango.jl:109
 [2] max_text_extents(::String, ::Measures.Length{:mm,Float64}, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/mwSoa/src/pango.jl:124
 [3] render(::Gadfly.Guide.HelpScreen, ::Theme, ::Gadfly.Aesthetics) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/guide.jl:76
 [4] render(::Gadfly.Guide.HelpScreen, ::Theme, ::Gadfly.Aesthetics, ::Bool) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/guide.jl:141
 [5] #render_prepared#105(::Bool, ::Bool, ::typeof(Gadfly.render_prepared), ::Plot, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:826
 [6] render_prepared(::Plot, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics, ::Array{Gadfly.Aesthetics,1}, ::Array{Array{Gadfly.StatisticElement,1},1}, ::Array{Array{Gadfly.Aesthetics,1},1}, ::Array{Array{Gadfly.Data,1},1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Array{Gadfly.GuideElement,1}) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:806
 [7] render(::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:752
 [8] draw at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:857 [inlined]
 [9] display(::Gadfly.GadflyDisplay, ::MIME{Symbol("text/html")}, ::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:1061
 [10] display(::Gadfly.GadflyDisplay, ::String, ::Any) at ./multimedia.jl:214
 [11] display(::Gadfly.GadflyDisplay, ::Plot) at /home/dehann/.julia/packages/Gadfly/1wgcD/src/Gadfly.jl:1018
 [12] display(::Any) at ./multimedia.jl:323
 [13] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [14] invokelatest at ./essentials.jl:789 [inlined]
 [15] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:156
 [16] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:141
 [17] (::getfield(REPL, Symbol("#do_respond#38")){Bool,getfield(REPL, Symbol("##48#57")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:718
 [18] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [19] invokelatest at ./essentials.jl:789 [inlined]
 [20] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2306
 [21] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:1038
 [22] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:201
 [23] (::getfield(Base, Symbol("##737#739")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:390
 [24] #invokelatest#1 at ./essentials.jl:790 [inlined]
 [25] invokelatest at ./essentials.jl:789 [inlined]
 [26] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:374
 [27] exec_options(::Base.JLOptions) at ./client.jl:312
 [28] _start() at ./client.jl:464

Fix 2 has Compat Issues

(v1.2) pkg> add Compose@v0.6

 └─restricted by compatibility requirements with Gadfly [c91e804a] to versions: 0.7.0-0.7.4 — no versions left

Import Fix also doesnt work in combination

(v1.2) pkg> add Compose
 Resolving package versions...
  Updating `~/.julia/environments/v1.2/Project.toml`
  [a81c6b42] ~ Compose v0.7.4 #master (https://github.com/GiovineItalia/Compose.jl.git) ⇒ v0.7.4
  Updating `~/.julia/environments/v1.2/Manifest.toml`
  [a81c6b42] ~ Compose v0.7.4 #master (https://github.com/GiovineItalia/Compose.jl.git) ⇒ v0.7.4

julia> import Cairo

julia> using Gadfly
[ Info: Recompiling stale cache file /home/dehann/.julia/compiled/v1.2/Gadfly/DvECm.ji for Gadfly [c91e804a-d5a3-530f-b6f0-dfbca275c004]

julia> using Fontconfig
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/../etc/fonts/fonts.conf
WARNING: Cairo._jl_libpangocairo is deprecated, use Cairo.libpango instead.
  likely near /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:3
WARNING: Cairo._jl_libpango is deprecated, use Cairo.libpango instead.
  likely near /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:4
WARNING: Cairo._jl_libgobject is deprecated, use Cairo.libgobject instead.
  likely near /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:5
┌ Warning: Error requiring Fontconfig from Compose:
│ ccall: could not find function pango_cairo_font_map_new in library /home/dehann/.julia/packages/Cairo/htbtf/deps/usr/lib/libpango-1.0.so
│ Stacktrace:
│  [1] link_fontconfig() at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:160
│  [2] top-level scope at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:177
│  [3] eval at ./boot.jl:330 [inlined]
│  [4] eval at /home/dehann/.julia/packages/Compose/UIDMc/src/Compose.jl:1 [inlined]
│  [5] (::getfield(Compose, Symbol("##117#123")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:67
│  [6] err(::getfield(Compose, Symbol("##117#123")), ::Module, ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:38
│  [7] #116 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:66 [inlined]
│  [8] withpath(::getfield(Compose, Symbol("##116#122")), ::String) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:28
│  [9] (::getfield(Compose, Symbol("##115#121")))() at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:65
│  [10] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [11] invokelatest at ./essentials.jl:789 [inlined]
│  [12] #3 at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19 [inlined]
│  [13] iterate at ./generator.jl:47 [inlined]
│  [14] _collect(::Array{Function,1}, ::Base.Generator{Array{Function,1},getfield(Requires, Symbol("##3#4"))}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:619
│  [15] map at ./array.jl:548 [inlined]
│  [16] loadpkg(::Base.PkgId) at /home/dehann/.julia/packages/Requires/9Jse8/src/require.jl:19
│  [17] #invokelatest#1 at ./essentials.jl:790 [inlined]
│  [18] invokelatest at ./essentials.jl:789 [inlined]
│  [19] require(::Base.PkgId) at ./loading.jl:914
│  [20] require(::Module, ::Symbol) at ./loading.jl:906
│  [21] eval(::Module, ::Any) at ./boot.jl:330
│  [22] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
│  [23] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:118 [inlined]
│  [24] (::getfield(REPL, Symbol("##26#27")){REPL.REPLBackend})() at ./task.jl:268
└ @ Requires ~/.julia/packages/Requires/9Jse8/src/require.jl:40

julia> plot(y=randn(10), Geom.path)
Error showing value of type Plot:
ERROR: TypeError: in typeassert, expected Compose.PangoLayout, got Nothing
Stacktrace:
 [1] max_text_extents(::String, ::Float64, ::String, ::Vararg{String,N} where N) at /home/dehann/.julia/packages/Compose/UIDMc/src/pango.jl:109

The reason I'm trying to load the combination is to export PDF, PNG, SVG using Gadfly.

@Mattriks
Copy link
Member

For Fix 2 do add Cairo@0.6 not add Compose@0.6 (my post above does say that). As I also suggested above if you upgraded to Cairo 0.7, you may have to delete the Cairo package directory first.

@dehann
Copy link

dehann commented Sep 25, 2019

right, sorry -- trying again. Thanks!

@dehann
Copy link

dehann commented Sep 25, 2019

That worked, thanks! (sorry for misreading Cairo vs Compose)

$ cd ~/.julia/packages/
$ rm -rf Cairo/
$ cd ~/.julia/dev/
$ julia -O3
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.2) pkg> add Cairo@v0.6
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed Cairo ─ v0.6.0
  Updating `~/.julia/environments/v1.2/Project.toml`
  [159f3aea] + Cairo v0.6.0
  Updating `~/.julia/environments/v1.2/Manifest.toml`
  [159f3aea] ↓ Cairo v0.7.0 ⇒ v0.6.0
  Building Cairo → `~/.julia/packages/Cairo/p68X8/deps/build.log`

(v1.2) pkg> ^C

julia> using Cairo
[ Info: Recompiling stale cache file /home/dehann/.julia/compiled/v1.2/Cairo/l6vnT.ji for Cairo [159f3aea-2a34-519c-b102-8c37f9878175]

julia> using Gadfly, Fontconfig

julia> plot(y=randn(10), Geom.path)

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

Successfully merging a pull request may close this issue.

3 participants