fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.94k stars 285 forks source link

Unable to Load Packages #745

Closed BrettKnoss closed 3 years ago

BrettKnoss commented 3 years ago

I get this when I try to load plots.

     From worker 2:    ERROR: LoadError: UndefVarError: XRGB not defined
      From worker 2:    Stacktrace:
      From worker 2:     [1] top-level scope at C:\Users\Brett\.julia\packages\Colors\kc2v8\src\Colors.jl:7 (repeats 
2 times)
      From worker 2:     [2] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [3] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [4] top-level scope at none:2
      From worker 2:     [5] eval at .\boot.jl:331 [inlined]
      From worker 2:     [6] eval(::Expr) at .\client.jl:467
      From worker 2:     [7] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\Colors\kc2v8\src\Colors.jl:7        
      From worker 2:    ERROR: LoadError: Failed to precompile Colors [5ae59095-9a9b-59fe-a467-6f913c188581] to C:\Users\Brett\.julia\compiled\v1.5\Colors\NKjaT_mOjfj.ji.
      From worker 2:    Stacktrace:
      From worker 2:     [1] error(::String) at .\error.jl:33
      From worker 2:     [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
      From worker 2:     [3] _require(::Base.PkgId) at .\loading.jl:1030
      From worker 2:     [4] require(::Base.PkgId) at .\loading.jl:928
      From worker 2:     [5] require(::Module, ::Symbol) at .\loading.jl:923
      From worker 2:     [6] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [7] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [8] top-level scope at none:2
      From worker 2:     [9] eval at .\boot.jl:331 [inlined]
      From worker 2:     [10] eval(::Expr) at .\client.jl:467
      From worker 2:     [11] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\ColorSchemes\R4W4Y\src\ColorSchemes.jl:15
      From worker 2:    ERROR: LoadError: Failed to precompile ColorSchemes [35d6a980-a343-548e-a6ea-1d62b119f2f4] to C:\Users\Brett\.julia\compiled\v1.5\ColorSchemes\EO5fj_mOjfj.ji.
      From worker 2:    Stacktrace:
      From worker 2:     [1] error(::String) at .\error.jl:33
      From worker 2:     [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
      From worker 2:     [3] _require(::Base.PkgId) at .\loading.jl:1030
      From worker 2:     [4] require(::Base.PkgId) at .\loading.jl:928
      From worker 2:     [5] require(::Module, ::Symbol) at .\loading.jl:923
      From worker 2:     [6] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [7] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [8] top-level scope at none:2
      From worker 2:     [9] eval at .\boot.jl:331 [inlined]
      From worker 2:     [10] eval(::Expr) at .\client.jl:467
      From worker 2:     [11] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\PlotUtils\3Ttrk\src\PlotUtils.jl:3  
      From worker 2:    ERROR: LoadError: Failed to precompile PlotUtils [995b91a9-d308-5afd-9ec6-746e21dbc043] to C:\Users\Brett\.julia\compiled\v1.5\PlotUtils\YveHG_mOjfj.ji.
      From worker 2:    Stacktrace:
      From worker 2:     [1] error(::String) at .\error.jl:33
      From worker 2:     [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
      From worker 2:     [3] _require(::Base.PkgId) at .\loading.jl:1030
      From worker 2:     [4] require(::Base.PkgId) at .\loading.jl:928
      From worker 2:     [5] require(::Module, ::Symbol) at .\loading.jl:923
      From worker 2:     [6] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [7] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [8] top-level scope at none:2
      From worker 2:     [9] eval at .\boot.jl:331 [inlined]
      From worker 2:     [10] eval(::Expr) at .\client.jl:467
      From worker 2:     [11] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\Plots\vsE7b\src\Plots.jl:20
      From worker 2:    ERROR: LoadError: UndefVarError: XRGB not defined
      From worker 2:    Stacktrace:
      From worker 2:     [1] top-level scope at C:\Users\Brett\.julia\packages\Colors\kc2v8\src\Colors.jl:7 (repeats 
2 times)
      From worker 2:     [2] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [3] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [4] top-level scope at none:2
      From worker 2:     [5] eval at .\boot.jl:331 [inlined]
      From worker 2:     [6] eval(::Expr) at .\client.jl:467
      From worker 2:     [7] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\Colors\kc2v8\src\Colors.jl:7        
      From worker 2:    ERROR: LoadError: Failed to precompile Colors [5ae59095-9a9b-59fe-a467-6f913c188581] to C:\Users\Brett\.julia\compiled\v1.5\Colors\NKjaT_mOjfj.ji.
      From worker 2:    Stacktrace:
      From worker 2:     [1] error(::String) at .\error.jl:33
      From worker 2:     [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
      From worker 2:     [3] _require(::Base.PkgId) at .\loading.jl:1030
      From worker 2:     [4] require(::Base.PkgId) at .\loading.jl:928
      From worker 2:     [5] require(::Module, ::Symbol) at .\loading.jl:923
      From worker 2:     [6] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [7] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [8] top-level scope at none:2
      From worker 2:     [9] eval at .\boot.jl:331 [inlined]
      From worker 2:     [10] eval(::Expr) at .\client.jl:467
      From worker 2:     [11] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\ColorSchemes\R4W4Y\src\ColorSchemes.jl:15
      From worker 2:    ERROR: LoadError: Failed to precompile ColorSchemes [35d6a980-a343-548e-a6ea-1d62b119f2f4] to C:\Users\Brett\.julia\compiled\v1.5\ColorSchemes\EO5fj_mOjfj.ji.
      From worker 2:    Stacktrace:
      From worker 2:     [1] error(::String) at .\error.jl:33
      From worker 2:     [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
      From worker 2:     [3] _require(::Base.PkgId) at .\loading.jl:1030
      From worker 2:     [4] require(::Base.PkgId) at .\loading.jl:928
      From worker 2:     [5] require(::Module, ::Symbol) at .\loading.jl:923
      From worker 2:     [6] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [7] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [8] top-level scope at none:2
      From worker 2:     [9] eval at .\boot.jl:331 [inlined]
      From worker 2:     [10] eval(::Expr) at .\client.jl:467
      From worker 2:     [11] top-level scope at .\none:3
      From worker 2:    in expression starting at C:\Users\Brett\.julia\packages\PlotUtils\3Ttrk\src\PlotUtils.jl:3  
      From worker 2:    ERROR: LoadError: Failed to precompile PlotUtils [995b91a9-d308-5afd-9ec6-746e21dbc043] to C:\Users\Brett\.julia\compiled\v1.5\PlotUtils\YveHG_mOjfj.ji.
      From worker 2:    Stacktrace:
      From worker 2:     [1] error(::String) at .\error.jl:33
      From worker 2:     [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
      From worker 2:     [3] _require(::Base.PkgId) at .\loading.jl:1030
      From worker 2:     [4] require(::Base.PkgId) at .\loading.jl:928
      From worker 2:     [5] require(::Module, ::Symbol) at .\loading.jl:923
      From worker 2:     [6] include(::Function, ::Module, ::String) at .\Base.jl:380
      From worker 2:     [7] include(::Module, ::String) at .\Base.jl:368
      From worker 2:     [8] top-level scope at none:2
      From worker 2:     [9] eval at .\boot.jl:331 [inlined]
      From worker 2:     [10] eval(::Expr) at .\client.jl:467
      From worker 2:     [11] top-level scope at .\none:3
fonsp commented 3 years ago

Can you post this issue to Plots.jl instead? Be sure to include the output of running import Pkg; Pkg.status() in the REPL

BrettKnoss commented 3 years ago

I thought I did, where did I post it?

fonsp commented 3 years ago

This is Pluto.jl, the names are similar 😅

This is the one you are looking for: https://github.com/JuliaPlots/Plots.jl

BrettKnoss commented 3 years ago

The issue is when I try to add a package to Pluto

fonsp commented 3 years ago

Thanks -- I understand, my answer is that this is not a problem with Pluto.

Maybe you could try removing the folder C:\Users\Brett\.julia, make sure that you have no unsaved Pluto notebooks

BrettKnoss commented 3 years ago

I'm not sure, I'm ready to do that. I did remove all my Pluto notebooks. It keeps automatically saving books when I just want to play with features.

fonsp commented 3 years ago

Removing C:\Users\Brett\.julia will clear all package caches, which sometimes solves these kinds of problems. Deleting unsaved Pluto notebooks is an unfortunate side effect.

If you like you can delete every subfolder of C:\Users\Brett\.julia except C:\Users\Brett\.julia\pluto_notebooks

BrettKnoss commented 3 years ago

I'm not sure I,m willing to get rid of a whole folder, it works in the sample notebooks.

Do I need to put in

begin
    Pkg.add("Plots")
    using Plots
end

each time, or will I be able to use

using Plots
fonsp commented 3 years ago

This is something we're still working on. But right now, the easiest solution is to do

julia> ]
pkg> add Plots

once in the Julia REPL, and then launch Pluto. In your notebook, it's just using Plots (this will use the "global package environment" by default).

If you are sharing your notebook with others (e.g. students), the recommended approach is what I do in this notebook: https://computationalthinking.mit.edu/Fall20/hw3/

Let me know how it goes

BrettKnoss commented 3 years ago

Ok, got it, I'll put this on discourd, but I have a problem with loops, that the whole trickle-down thing(which I love!) causes an error of multiple definitions when trying to do loops and recursion.

fonsp commented 3 years ago

Thanks! We have an issue for this but i cant find it right now. The workaround is to use a begin...end block