# Cannot use modules in Jupyter-lab with Julia 1.6

**URL:** <https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291>\
**Category:** New to Julia\
**Created:** [March 31, 2021, 12:50pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291 "2021-03-31T12:50:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach1](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@erlebach1](https://discourse.julialang.org/u/erlebach1)\
**Post date:** [March 31, 2021, 12:50pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291/1 "2021-03-31T12:50:47Z")

</div>

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

```julia
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:

```julia
┌ 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!

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [March 31, 2021, 1:14pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291/2 "2021-03-31T13:14:50Z")

</div>

> [@erlebach1](#):
>
> 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:

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?)

---

<div class="post-metadata">

**Author:** ![erlebach1](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@erlebach1](https://discourse.julialang.org/u/erlebach1)\
**Post date:** [March 31, 2021, 5:21pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291/3 "2021-03-31T17:21:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Post date:** [March 31, 2021, 6:52pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291/4 "2021-03-31T18:52:18Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

**Author:** ![jacobusmmsmit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacobusmmsmit/32/217669_2.png) [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Post date:** [March 31, 2021, 7:59pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291/5 "2021-03-31T19:59:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![erlebach1](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@erlebach1](https://discourse.julialang.org/u/erlebach1)\
**Post date:** [March 31, 2021, 8:24pm UTC](https://discourse.julialang.org/t/cannot-use-modules-in-jupyter-lab-with-julia-1-6/58291/6 "2021-03-31T20:24:26Z")

</div>

> [@StatisticalMouse](#):
>
> ```julia
> 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()
> 
> ```

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 .
