JuliaPlots / Plots.jl

Powerful convenience for Julia visualizations and data analysis
https://docs.juliaplots.org
Other
1.84k stars 354 forks source link

PlotlyJS Backend is not working under Juno/Atom 1.8.0 and julia 0.6.0 #993

Closed BoundaryValueProblems closed 7 years ago

BoundaryValueProblems commented 7 years ago

Hello. I updated julia from v0.5.2 to v0.6.0 a few weeks ago. I'm using Plots v0.12.1 (the official released version). When I try to plot things with PlotlyJS Backend within a julia console under Juno/Atom editor, it doesn't work; nothing is plotted on the Plots Pane in the Juno/Atom editor. On the other hand, both GR and PyPlot Backends work without any issues. Here is the warning and error messages I get:

> using Plots
WARNING:
Error requiring Juno from Plots:
UndefVarError: PlotlyJSBackend not defined

Interestingly, if I do not use Juno/Atom editor, and simply run julia on a terminal, PlotlyJS Backend works without a problem. Is this a known problem? How can I resolve this issue? Any help would be highly appreciated.

Best regards, BVPs

mkborregaard commented 7 years ago

Could you post Pkg.status()?

BoundaryValueProblems commented 7 years ago

Yes, @mkborregaard, here is the output of Pkg.status():

julia> Pkg.status()
12 required packages:
 - ApproxFun                     0.6.1
 - Atom                          0.6.1
 - GLMNet                        0.2.0
 - GR                            0.22.0
 - JLD                           0.6.11
 - MAT                           0.3.2
 - PlotlyJS                      0.6.4
 - Plots                         0.12.1
 - PyPlot                        2.3.2
 - SingularIntegralEquations     0.2.3
 - SpecialFunctions              0.2.0
 - WAV                           0.8.5
69 additional packages:
 - BandedMatrices                0.2.3
 - BinDeps                       0.7.0
 - Blink                         0.5.3
 - Blosc                         0.3.0
 - BufferedStreams               0.3.3
 - Calculus                      0.2.2
 - CodeTools                     0.4.6
 - Codecs                        0.3.0
 - ColorTypes                    0.6.0
 - Colors                        0.8.0
 - Compat                        0.28.0
 - Conda                         0.5.3
 - Contour                       0.3.0
 - DataArrays                    0.6.2
 - DataFrames                    0.10.0
 - DataStructures                0.6.1
 - Distances                     0.4.1
 - Distributions                 0.14.2
 - DocStringExtensions           0.3.4
 - DualNumbers                   0.3.0
 - FastGaussQuadrature           0.2.1
 - FastTransforms                0.2.2
 - FileIO                        0.5.1
 - FixedPointNumbers             0.3.9
 - GZip                          0.3.0
 - HDF5                          0.8.3
 - Hiccup                        0.1.1
 - HierarchicalMatrices          0.0.2
 - Homebrew                      0.5.8
 - HttpCommon                    0.2.7
 - HttpParser                    0.3.0
 - HttpServer                    0.2.0
 - IntervalSets                  0.1.1
 - JSON                          0.13.0
 - Juno                          0.3.0
 - LNR                           0.0.2
 - LaTeXStrings                  0.2.1
 - Lazy                          0.11.7
 - LegacyStrings                 0.2.2
 - Libz                          0.2.4
 - LowRankApprox                 0.0.2
 - MTSG                          0.0.0-             master (unregistered)
 - MacroTools                    0.3.7
 - MbedTLS                       0.4.5
 - Measures                      0.1.0
 - Media                         0.3.0
 - Mustache                      0.1.4
 - Mux                           0.2.3
 - NaNMath                       0.2.6
 - PDMats                        0.7.0
 - PlotThemes                    0.1.4
 - PlotUtils                     0.4.3
 - ProgressMeter                 0.3.4
 - PyCall                        1.14.0
 - QuadGK                        0.1.2
 - RecipesBase                   0.2.0
 - Reexport                      0.0.3
 - Requires                      0.4.3
 - Rmath                         0.1.7
 - SHA                           0.5.0
 - Showoff                       0.1.1
 - SortingAlgorithms             0.1.1
 - StaticArrays                  0.6.1
 - StatsBase                     0.18.0
 - StatsFuns                     0.5.0
 - ToeplitzMatrices              0.2.0
 - Tokenize                      0.2.0
 - URIParser                     0.1.8
 - WebSockets                    0.2.3
pfitzseb commented 7 years ago

Hm, I can't reproduce this with Plots and Atom on the latest releases.

thatlittleboy commented 7 years ago

I can confirm that the same error is occurring for me, on a freshly installed Julia v0.6.0, Windows 10, with Atom editor (v1.18.0) + Juno, after passing using Plots in the command prompt within the Juno/Atom interface. Similarly, no errors pop up if I do so in the julia terminal. My pkg.status() is as follows:

4 required packages:
 - Atom                          0.6.1
 - Distributions                 0.14.2
 - Plots                         0.12.1
 - PyPlot                        2.3.2
46 additional packages:
 - BinDeps                       0.7.0
 - Blink                         0.5.3
 - Calculus                      0.2.2
 - CodeTools                     0.4.6
 - Codecs                        0.3.0
 - ColorTypes                    0.6.0
 - Colors                        0.8.0
 - Compat                        0.29.0
 - Conda                         0.7.0
 - Contour                       0.4.0
 - DataStructures                0.6.1
 - FixedPointNumbers             0.3.9
 - Hiccup                        0.1.1
 - HttpCommon                    0.2.7
 - HttpParser                    0.3.0
 - HttpServer                    0.2.0
 - JSON                          0.13.0
 - Juno                          0.3.0
 - LNR                           0.0.2
 - LaTeXStrings                  0.2.1
 - Lazy                          0.11.7
 - MacroTools                    0.3.7
 - MbedTLS                       0.4.5
 - Measures                      0.1.0
 - Media                         0.3.0
 - Mustache                      0.1.4
 - Mux                           0.2.3
 - NaNMath                       0.2.6
 - PDMats                        0.7.0
 - PlotThemes                    0.1.4
 - PlotUtils                     0.4.3
 - PyCall                        1.14.0
 - QuadGK                        0.1.3
 - RecipesBase                   0.2.0
 - Reexport                      0.0.3
 - Requires                      0.4.3
 - Rmath                         0.1.7
 - SHA                           0.5.0
 - Showoff                       0.1.1
 - SpecialFunctions              0.2.0
 - StaticArrays                  0.6.1
 - StatsBase                     0.18.0
 - StatsFuns                     0.5.0
 - Tokenize                      0.3.0
 - URIParser                     0.2.0
 - WebSockets                    0.2.3
mkborregaard commented 7 years ago

Do you still have this? None of us seem able to replicate, even with the same package profile.

currymj commented 7 years ago

I also have this problem, just discovered it now, on a fresh install of the release version of Julia 0.6, after nuking ~/.julia completely.

I'm going to try a fresh install of Atom as well.

(Problem remains after reinstalling Atom.)

using Plots
WARNING: Error requiring Juno from Plots:
UndefVarError: PlotlyJSBackend not defined

Pkg.status()
5 required packages:
 - Atom                          0.6.1
 - DifferentialEquations         2.2.1
 - PlotlyJS                      0.6.4
 - Plots                         0.12.1
 - PyPlot                        2.3.2
110 additional packages:
 - AlgebraicDiffEq               0.1.0
 - BinDeps                       0.7.0
 - Blink                         0.5.3
 - Calculus                      0.2.2
 - ChunkedArrays                 0.1.1
 - CodeTools                     0.4.6
 - Codecs                        0.3.0
 - ColorTypes                    0.6.0
 - Colors                        0.8.0
 - Combinatorics                 0.4.1
 - CommonSubexpressions          0.0.1
 - Compat                        0.29.0
 - Conda                         0.7.0
 - Contour                       0.4.0
 - DataArrays                    0.6.2
 - DataFrames                    0.10.1
 - DataStructures                0.6.1
 - DelayDiffEq                   0.6.0
 - DiffBase                      0.2.0
 - DiffEqBase                    1.18.1
 - DiffEqBiological              0.2.0
 - DiffEqCallbacks               0.2.1
 - DiffEqDevTools                0.9.3
 - DiffEqFinancial               0.3.0
 - DiffEqJump                    0.5.0
 - DiffEqMonteCarlo              0.9.0
 - DiffEqNoiseProcess            0.3.2
 - DiffEqPDEBase                 0.3.4
 - DiffEqParamEstim              0.5.0
 - DiffEqSensitivity             0.3.0
 - DiffEqUncertainty             0.0.1
 - DimensionalPlotRecipes        0.0.2
 - Distances                     0.5.0
 - DistributedArrays             0.4.0
 - Distributions                 0.14.2
 - DocStringExtensions           0.3.4
 - EllipsisNotation              0.2.2
 - FileIO                        0.5.1
 - FiniteElementDiffEq           0.4.0
 - FixedPointNumbers             0.3.9
 - ForwardDiff                   0.5.0
 - GZip                          0.3.0
 - GenericSVD                    0.1.0
 - Hiccup                        0.1.1
 - HttpCommon                    0.2.7
 - HttpParser                    0.3.0
 - HttpServer                    0.2.0
 - IterTools                     0.1.0
 - IterativeSolvers              0.3.1
 - JSON                          0.13.0
 - Juno                          0.3.0
 - LNR                           0.0.2
 - LaTeXStrings                  0.2.1
 - Lazy                          0.11.7
 - LearnBase                     0.1.6
 - LineSearches                  2.2.1
 - LinearMaps                    1.0.1
 - LossFunctions                 0.1.0
 - LsqFit                        0.3.0
 - MacroTools                    0.3.7
 - MbedTLS                       0.4.5
 - Measures                      0.1.0
 - Media                         0.3.0
 - MuladdMacro                   0.0.2
 - MultiScaleArrays              0.4.0
 - Mustache                      0.1.4
 - Mux                           0.2.3
 - NLSolversBase                 2.1.3
 - NLsolve                       0.11.0
 - NaNMath                       0.2.6
 - Optim                         0.9.3
 - OptimBase                     0.1.0
 - OrdinaryDiffEq                2.13.0
 - PDMats                        0.7.0
 - ParameterizedFunctions        2.2.0
 - Parameters                    0.7.2
 - PlotThemes                    0.1.4
 - PlotUtils                     0.4.3
 - Polynomials                   0.1.6
 - PositiveFactorizations        0.0.4
 - Primes                        0.1.3
 - PyCall                        1.14.0
 - QuadGK                        0.1.3
 - RandomNumbers                 0.1.0
 - RealInterface                 0.0.3
 - RecipesBase                   0.2.0
 - RecursiveArrayTools           0.11.2
 - Reexport                      0.0.3
 - Requires                      0.4.3
 - ResettableStacks              0.1.0
 - Rmath                         0.2.0
 - Roots                         0.4.0
 - SHA                           0.5.0
 - Showoff                       0.1.1
 - SimpleTraits                  0.5.0
 - SortingAlgorithms             0.1.1
 - SpecialFunctions              0.3.0
 - StaticArrays                  0.6.1
 - StatsBase                     0.18.0
 - StatsFuns                     0.5.0
 - SteadyStateDiffEq             0.1.0
 - StochasticDiffEq              2.10.0
 - SugarBLAS                     0.0.4
 - Sundials                      0.13.0
 - SymEngine                     0.2.0
 - Tokenize                      0.3.0
 - URIParser                     0.2.0
 - UnicodePlots                  0.2.4
 - VectorizedRoutines            0.0.2
 - WebSockets                    0.2.3
mkborregaard commented 7 years ago

@pfitzseb do you think this could be related to #916 ?

pfitzseb commented 7 years ago

Probably? Still can't reproduce this though. @currymj Can you try Pkg.checkout("Atom")?

xiaoweiz commented 7 years ago

I'm having the same problem on OSX with Julia 0.6 and Atom 1.18.0. Neither plotlyjs() nor plotly() works. But other backends including gr(), pyplot(), and pgfplots() work.

mkborregaard commented 7 years ago

And do you also get the error message immediately upon using Plots, or only after trying plotlyjs()? It is the first behaviour that's most mysterious.

xiaoweiz commented 7 years ago

Immediately upon using Plots in Atom. The error message appears in the console pane of the editor. It works perfectly in JupyterNotebook, though.

mkborregaard commented 7 years ago

Could you try to check out Plots "before916" and "after916" branches and see if you can replicate?

mkborregaard commented 7 years ago

No, before doing that, try to check out "mkborregaard/fix-993". It just might work.

xiaoweiz commented 7 years ago

How can I checkout a branch? I tried Pkg.checkout("Plots", "after916"), Pkg.checkout("Plots", "before916"), and Pkg.checkout("mkborregaard/fix-993"). All fail.

thatlittleboy commented 7 years ago

@xiaoweiz Try those after checking out the master version, i.e. Pkg.checkout("Plots"). It works for me.

@mkborregaard Some updates:

I tried with Pkg.checkout("Plots","before916") atom_2017-08-09_09-52-52 and got this after using Plots:

WARNING: Method definition 
show(IO, Base.MIME{Symbol("text/plain")}, Plots.Plot{B}) in module Plots at C:\Users\USER\.julia\v0.6\Plots\src\output.jl:196 overwritten in module Main at C:\Users\USER\.julia\v0.6\Plots\src\output.jl:289.

With Pkg.checkout("Plots","after916"), atom_2017-08-09_09-48-19 I got the reported warning:

WARNING: Error requiring Juno from Plots:
UndefVarError: PlotlyJSBackend not defined
Stacktrace:
 [1] err(::Plots.##258#265, ::Module, ::String) at C:\Users\USER\.julia\v0.6\Requires\src\require.jl:42
 [2] withpath(::Plots.##257#264, ::String) at C:\Users\USER\.julia\v0.6\Requires\src\require.jl:32
 [3] listenmod(::Plots.##256#263, ::Symbol) at C:\Users\USER\.julia\v0.6\Requires\src\require.jl:13
 [4] include_from_node1(::String) at .\loading.jl:569
 [5] include(::String) at .\sysimg.jl:14
 [6] include_from_node1(::String) at .\loading.jl:569
 [7] eval(::Module, ::Any) at .\boot.jl:235
 [8] _require(::Symbol) at .\loading.jl:483
 [9] require(::Symbol) at .\loading.jl:398
 [10] include_string(::String, ::String) at .\loading.jl:515
 [11] eval(::Module, ::Any) at .\boot.jl:235
 [12] (::Atom.##61#64)() at C:\Users\USER\.julia\v0.6\Atom\src\eval.jl:102
 [13] withpath(::Atom.##61#64, ::Void) at C:\Users\USER\.julia\v0.6\CodeTools\src\utils.jl:30
 [14] withpath(::Function, ::Void) at C:\Users\USER\.julia\v0.6\Atom\src\eval.jl:38
 [15] macro expansion at C:\Users\USER\.julia\v0.6\Atom\src\eval.jl:101 [inlined]
 [16] (::Atom.##60#63{Dict{String,Any}})() at .\task.jl:80

With Pkg.checkout("Plots","mkborregaard/fix-993") atom_2017-08-09_09-49-48 I still get the reported error:

WARNING: Error requiring Juno from Plots:
UndefVarError: PlotlyJSBackend not defined

With Pkg.checkout("Plots") (i.e. master version) atom_2017-08-09_09-53-54 I get no error after using Plots.

xiaoweiz commented 7 years ago

I confirm simply checking out the current master version (Pkg.checkout("Plots")) solves the problem.

mkborregaard commented 7 years ago

Hm, sounds like an issue with Pkg caching. @BoundaryValueProblems does checking out master solve your problem too?

BoundaryValueProblems commented 7 years ago

@mkborregaard, yes, I just ran Pkg.checkout("Plots"), and PlotlyJS backend is now working! Thanks a lot everyone for your help! I hope that this change will be included in the next official release of Plots.jl.

ChrisRackauckas commented 7 years ago

I'm seeing this on release as well, but fixed on master. We may want to tag master sooner rather than later since this effects newcomers on their first plots.

mkborregaard commented 7 years ago

The only difference between release 0.12.1 and master is that precompilation is allowed on master. The metadata maintainer will not allow us to have active precompilation on releases for principal reasons, but since it works in practice it is turned on for master. For this reason alone I'd recommend anyone to use Plots master, rather than the release version.

Unfortunately, this means that the fix here cannot be included in a release. I was able to replicate the issue by removing my Plots.ji file and turning off precompilation. Turning it on again fixed it. But the fix in mkborregaard-fix993 did work on my system, even without precompilation. I've added that to master and pushed a new release, just in case that might take care of it. It'd be nice if some of you could try Pkg.free("Plots") to get on the released version, to see if it is better now before closing the issue.

xiaoweiz commented 7 years ago

Confirm that the new release 0.12.2 solves the issue.

BoundaryValueProblems commented 7 years ago

@mkborregaard , the new release 0.12.2 also worked for me as @xiaoweiz said. However, after updating to 0.12.2 and running using Plots, it generated the following error. Only after running using Plots once more, finally I could plot things. Is this an expected behavior?

INFO: Recompiling stale cache file C:\Users\xxx\.julia\lib\v0.6\Plots.ji for module Plots.
ERROR: LoadError: 
Declaring __precompile__(false) is not allowed in files that are being precompiled.
Stacktrace:
 [1] 
__precompile__(::Bool) at .\loading.jl:335
 [2] include_from_node1(::String) at .\loading.jl:569
 [3] include(::String) at .\sysimg.jl:14
 [4] anonymous at .\<missing>:2
while loading C:\Users\xxx\.julia\v0.6\Plots\src\Plots.jl, in expression starting on line 1
Failed to precompile Plots to C:\Users\xxx\.julia\lib\v0.6\Plots.ji.
in require at base\loading.jl:398
in _require at base\loading.jl:456
in compilecache at base\loading.jl:703
mkborregaard commented 7 years ago

Well, it's a response to precompilation being turned off for a package, and will only occur once. But again, I'd strongly recommend just staying on master.

BoundaryValueProblems commented 7 years ago

@mkborregaard , thanks! OK, I'll stay on master from now on.

ankit48365 commented 4 years ago

Probably? Still can't reproduce this though. @currymj Can you try Pkg.checkout("Atom")?

Guys, I can't run this command, where do we run this command from to checkout,

image

BoundaryValueProblems commented 4 years ago

@ankit48365: This thread is obsolete. Also, Pkg.checkout command is obsolete after Julia v1.0. Since you are using Julia v1.4.1, you need to use either Pkg.add or Pkg.develop depending on what you want to do. The following discourse forum thread may be of your help: https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907 Also, please check the latest manual of Pkg.jl: https://docs.julialang.org/en/v1/stdlib/Pkg/ or more details at: https://julialang.github.io/Pkg.jl/v1/ Best, BVPs

ankit48365 commented 4 years ago

@ankit48365: This thread is obsolete. Also, Pkg.checkout command is obsolete after Julia v1.0. Since you are using Julia v1.4.1, you need to use either Pkg.add or Pkg.develop depending on what you want to do. The following discourse forum thread may be of your help: https://discourse.julialang.org/t/pkg-checkout-in-julia-1-0/13907 Also, please check the latest manual of Pkg.jl: https://docs.julialang.org/en/v1/stdlib/Pkg/ or more details at: https://julialang.github.io/Pkg.jl/v1/ Best, BVPs

@BoundaryValueProblems - Thank you, You have resolved my issues