Cannot use modules in Jupyter-lab with Julia 1.6

Hi,
I installed Julia 1.6, and it runs perfectly with several packages. I then ran Jupyter-lab, and tried

using Plots

in a Julia 1.6 environment. Jupyter-lab then tried to compile Plots. Why would it do that since it was already compile (yes, I did a build IJulia in Atom). Here is what I see in Jupyter-lab:

┌ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
└ @ Base loading.jl:1317
ERROR: LoadError: ArgumentError: Package EarCut_jll does not have JLLWrappers in its dependencies:
- If you have EarCut_jll checked out for development and have
  added JLLWrappers as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with EarCut_jll
Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:884
 [2] include
   @ ./Base.jl:386 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1213
 [4] top-level scope
   @ none:1
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [7] top-level scope
   @ none:1
in expression starting at /Users/erlebach/.julia/packages/EarCut_jll/Jp1Xm/src/EarCut_jll.jl:2
ERROR: LoadError: Failed to precompile EarCut_jll [5ae413db-bbd1-5e63-b57d-d24a61df00f5] to /Users/erlebach/.julia/compiled/v1.6/EarCut_jll/jl_YhLpeO.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{Base.PipeEndpoint})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/erlebach/.julia/packages/GeometryBasics/qasyR/src/GeometryBasics.jl:1
ERROR: LoadError: Failed to precompile GeometryBasics [5c1252a2-5f33-56bf-86c9-59e7332b4326] to /Users/erlebach/.julia/compiled/v1.6/GeometryBasics/jl_w1bQ40.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{Base.PipeEndpoint})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/erlebach/.julia/packages/Plots/YicDu/src/Plots.jl:1
Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /Users/erlebach/.julia/compiled/v1.6/Plots/jl_gtXnSQ.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IJulia.IJuliaStdio{Base.PipeEndpoint}, internal_stdout::IJulia.IJuliaStdio{Base.PipeEndpoint})
   @ Base ./loading.jl:1360
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1306
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1021
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:914
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:901
 [7] eval
   @ ./boot.jl:360 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1094

Any help is appreciated. Thanks!

Maybe you are running in a different environment? use ] st to print out the package status and the current environment in both Jupyter and the REPL. (You tried the REPL, not just Atom, right?)

You are correct! I did a status both in the REPL of Atom and via the Terminal and get the same version 0.15.1 for Turing. In Jupyter, using Julia 1.6, I get Turing version 0.14.3 !!

What could I be doing wrong? I did a build of IJulia inside Atom. Of course, I could completely reinstall Atom, but seems like overkill. I obviously did things correctly under ~/.julia; otherwise, I would not be able to get the packges to be correct in the Atom REPL. Any advice? Thanks!

Goron

I usually put something like this at the start of every Jupyter notebook:

ENV["COLUMNS"] = 200 # wide output is OK
ENV["LINES"] = 15; # but we do not want it to be overly tall
cd(@__DIR__)
using Pkg
Pkg.activate(".")
Pkg.status()

This makes it really obvious which environment I’m using and what’s inside.

2 Likes

That’s a neat trick, I’m gonna steal that :wink:

1 Like

Yes, I will adopt this trick as well. Thanks. And my problem is solved. The directory I started Jupyter from had a Project.toml and a Manifest file. I simply removed Pkg.activate(".") and changed the name of the project.toml file, and now my environment matches that of Julia 1.6 .

2 Likes