1
julia> using Pkg

julia> Pkg.add("IJulia")
  Installing known registries into `~/.julia`
  ...

By default:

  • Installs known registries into ~/.julia
  • Install kernel into ~/.local/share/jupyter/kernels/julia-1.8

Is it possible to do a system install instead of local install? e.g.

  • /usr/.julia
  • /usr/local/share/jupyter/kernels/julia-1.8

I know specifying kernel path is possible from the Jupyter side: https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernel-specs

But not sure if or how you can invoke this behavior from the julia shell https://julialang.github.io/IJulia.jl/stable/manual/installation/

Using Linux OS

Rob
  • 14,746
  • 28
  • 47
  • 65
ryanhill1
  • 165
  • 1
  • 9

1 Answers1

0

IJulia.jl installs kernels using the JUPYTER_DATA_DIR environment variable. This can be set via your shell, or in Julia as

ENV["JUPYTER_DATA_DIR"] = "/usr/local/share/jupyter/"

(see https://github.com/JuliaLang/IJulia.jl/blob/master/deps/kspec.jl) You can be even more fine-grained at the level of installkernel: see IJulia.installkernel

Where the .julia directory is located is an entirely different question, and is controlled by the JULIA_DEPOT_PATH environment variable: see https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_DEPOT_PATH

This in turn is used to define Base.DEPOT_PATH which can be called in the Julia REPL to see its value.

jd-foster
  • 1
  • 2