JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
422 stars 78 forks source link

PlotlyJS (as a Plots.jl backend) now fails in Juno (Atom) on Ubuntu 16.04 #142

Closed Sleort closed 6 years ago

Sleort commented 6 years ago

In the REPL, running

using Plots
plotlyjs()

works fine. The same was the case a few days ago in Juno. However, now I get the following error message when I try to switch to the plotlyjs() backend:

(julia:19678): Gtk-WARNING **: GTK+ module /snap/atom/50/usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libunity-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: Failed to load module "unity-gtk-module"

Any idea of what's going on / how to fix this?

sglyon commented 6 years ago

Will you please post the result of Pkg.status()

Sleort commented 6 years ago

@sglyon Sure:

julia> Pkg.status()
36 required packages:
 - Atom                          0.6.2+             master
 - BenchmarkTools                0.0.8
 - Bootstrap                     1.1.0
 - CatViews                      0.1.0+             master
 - DoubleDouble                  0.2.1
 - DynamicalBilliards            1.6.0              master
 - Flux                          0.3.3
 - ForwardDiff                   0.6.0
 - GLMNet                        0.3.0
 - GLVisualize                   0.6.1
 - GR                            0.24.0
 - ImageMagick                   0.5.0
 - Images                        0.11.3
 - JLD                           0.8.3
 - JLD2                          0.0.4
 - KernelDensity                 0.3.2
 - LightGraphs                   0.11.0
 - LsqFit                        0.3.0
 - MNIST                         0.0.2
 - Memoize                       0.2.0
 - NLsolve                       0.12.1
 - NumericIO                     0.2.0
 - ParallelDataTransfer          0.3.0+             master
 - PlotRecipes                   0.2.0
 - PlotlyJS                      0.7.0
 - Plots                         0.13.1
 - Polynomials                   0.1.6
 - ProfileView                   0.3.0
 - ProgressMeter                 0.5.0
 - PyPlot                        2.3.2
 - ReverseDiff                   0.2.0
 - Roots                         0.4.1
 - Rsvg                          0.1.0
 - StatPlots                     0.5.1
 - StaticArrays                  0.6.4
 - UnicodePlots                  0.2.5
151 additional packages:
 - AbstractFFTs                  0.2.0
 - AxisAlgorithms                0.2.0
 - AxisArrays                    0.2.0
 - BinDeps                       0.6.0
 - Blink                         0.5.3
 - Blosc                         0.3.0
 - BufferedStreams               0.3.3
 - Cairo                         0.3.1
 - Calculus                      0.2.2
 - CatIndices                    0.1.0
 - CodeTools                     0.4.7
 - CodecZlib                     0.4.0
 - Codecs                        0.4.0
 - ColorTypes                    0.6.5
 - ColorVectorSpace              0.5.1
 - Colors                        0.8.1
 - CommonSubexpressions          0.0.1
 - Compat                        0.34.0
 - ComputationalResources        0.2.0
 - Conda                         0.7.0              master
 - Contour                       0.4.0
 - CoordinateTransformations     0.4.1
 - CustomUnitRanges              0.1.0
 - DataArrays                    0.6.2
 - DataFlow                      0.3.0
 - DataFrames                    0.10.1
 - DataStructures                0.7.2
 - DataValues                    0.3.0
 - DiffBase                      0.3.2
 - DiffResults                   0.0.1
 - DiffRules                     0.0.1
 - Distances                     0.5.0
 - Distributions                 0.15.0             master
 - DocSeeker                     0.1.0
 - DocStringExtensions           0.4.1
 - DualNumbers                   0.3.0
 - FFTViews                      0.1.0
 - FFTW                          0.0.4
 - FactCheck                     0.4.3
 - FileIO                        0.5.2
 - FixedPointNumbers             0.4.3
 - FreeType                      1.3.0
 - FreeTypeAbstraction           0.1.0
 - FunctionWrappers              0.1.0
 - GLAbstraction                 0.5.1
 - GLFW                          1.4.0
 - GLWindow                      0.7.0
 - GZip                          0.3.0
 - GeometryTypes                 0.4.2
 - Graphics                      0.2.0
 - Gtk                           0.13.1
 - GtkReactive                   0.4.0
 - HDF5                          0.8.6
 - Hiccup                        0.1.1
 - HttpCommon                    0.3.0
 - HttpParser                    0.3.0
 - HttpServer                    0.2.0
 - IdentityRanges                0.1.0
 - ImageAxes                     0.3.1
 - ImageCore                     0.4.1
 - ImageFiltering                0.2.2
 - ImageMetadata                 0.3.0
 - ImageMorphology               0.0.2
 - ImageTransformations          0.4.0
 - IndirectArrays                0.2.0
 - Interpolations                0.7.0
 - IntervalSets                  0.1.1
 - IterTools                     0.1.0
 - IterableTables                0.5.2
 - Iterators                     0.3.1
 - JSON                          0.15.1
 - Juno                          0.3.1
 - LNR                           0.0.2
 - LaTeXStrings                  0.3.0
 - Lazy                          0.12.0
 - Learn                         0.0.0-             master (unregistered)
 - LearnBase                     0.1.6
 - LearningStrategies            0.2.0
 - LegacyStrings                 0.2.2
 - Libz                          0.2.4
 - LineSearches                  3.0.1
 - Loess                         0.3.0
 - LossFunctions                 0.2.0
 - MLDataPattern                 0.1.2
 - MLDataUtils                   0.2.0
 - MLLabelUtils                  0.1.4
 - MLMetrics                     0.0.0-             master (unregistered)
 - MacroTools                    0.4.0
 - MappedArrays                  0.0.7
 - MbedTLS                       0.5.1
 - Measures                      0.1.0
 - Media                         0.3.0
 - MeshIO                        0.1.0
 - ModernGL                      0.2.1
 - Mustache                      0.3.0
 - Mux                           0.2.3
 - NLSolversBase                 3.1.0
 - NNlib                         0.1.3
 - NaNMath                       0.2.6
 - NamedTuples                   4.0.0
 - NetworkLayout                 0.1.1
 - ObjectiveFunctions            0.0.0-             master (unregistered)
 - OffsetArrays                  0.4.2
 - OnlineStats                   0.12.0
 - OnlineStatsBase               0.1.0
 - Optim                         0.10.0
 - OptimBase                     0.1.0
 - PDMats                        0.7.1
 - Packing                       0.1.0
 - PaddedViews                   0.2.0
 - Parameters                    0.8.0
 - PenaltyFunctions              0.0.1+             master
 - PlotThemes                    0.1.4
 - PlotUtils                     0.4.4
 - PositiveFactorizations        0.1.0
 - PyCall                        1.15.0
 - QuadGK                        0.1.3
 - Quaternions                   0.3.0
 - RangeArrays                   0.2.0
 - Ratios                        0.2.0
 - Reactive                      0.6.0
 - RecipesBase                   0.2.3
 - Reexport                      0.0.3
 - Requires                      0.4.3
 - Rmath                         0.3.0
 - Rotations                     0.6.0
 - RoundingIntegers              0.0.3
 - SHA                           0.5.1
 - SIUnits                       0.1.0
 - ShowItLikeYouBuildIt          0.2.0
 - Showoff                       0.1.1
 - SignedDistanceFields          0.2.0
 - SimpleTraits                  0.5.1
 - SortingAlgorithms             0.1.1
 - SpecialFunctions              0.3.4
 - StatsBase                     0.19.0
 - StatsFuns                     0.5.0
 - StochasticOptimization        0.0.0-             master (unregistered)
 - StringDistances               0.2.0
 - SweepOperator                 0.1.0
 - TableTraits                   0.0.1
 - TableTraitsUtils              0.1.0
 - TexExtensions                 0.1.0
 - TiledIteration                0.1.0
 - Tokenize                      0.4.2
 - TranscodingStreams            0.3.1
 - Transformations               0.0.0-             master (unregistered)
 - URIParser                     0.2.0
 - UnicodeFun                    0.1.0
 - WebSockets                    0.2.3
 - WoodburyMatrices              0.2.2
sglyon commented 6 years ago

It looks like a problem with gtk.jl.

Can you try

Pkg.rm("Gtk")
Pkg.add("Gtk")

If that doesn't work it might be worthwhile to post an issue over there, but let's see what we can do here first.

Sleort commented 6 years ago

Can you try

Pkg.rm("Gtk") Pkg.add("Gtk")

Nothing changed...

sglyon commented 6 years ago

What happens when you try to do

using Gtk

In a fresh Julia session?

Sleort commented 6 years ago

It works fine in the REPL, but returns

(julia:27582): Gtk-WARNING **: GTK+ module /snap/atom/50/usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libunity-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: Failed to load module "unity-gtk-module"

if I do the same in Juno.

So yes, I guess this is an issue for Gtk.jl, or maybe Juno...

sglyon commented 6 years ago

Yeah, I'm afraid this is outside the scope of PlotlyJS.jl. I'd probably start with asking people over at Gtk.jl.

That being said, if you still want to use PlotlyJS.jl inside Juno while you wait for this to be resolved you can change this line

from

@static if isinstalled("Cairo") && isinstalled("Rsvg")

to

@static if false

This will disable saving png, pdf, or eps -- but will not cause Gtk/Cairo/Rsvg to be loaded.

Sleort commented 6 years ago

I opened an issue over at Gtk.jl, so let's see...

Great! The (temporary) workaround solved the problem inside Juno (which was the main issue for me). Now I can go back to making nice, interactive 3D plots!

Thank you very much for your help!