JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.78k stars 409 forks source link

Installing IJulia with IJULIA_NODEFAULTKERNEL fails #1036

Open ARogovskyy opened 2 years ago

ARogovskyy commented 2 years ago

If I install IJulia with IJULIA_NODEFAULTKERNEL, it fails. Stacktrae

ERROR: LoadError: UndefVarError: exe not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/IJulia/e8kqU/deps/build.jl:18
 [2] include(fname::String)
   @ Base.MainInclude ./client.jl:451
 [3] top-level scope
   @ none:5

The exe function is defined in deps/kspec.jl. However, this is only (indirectly) run in build.jl during the installation of the default kernel:

 if !haskey(ENV, "IJULIA_NODEFAULTKERNEL")
    # Install Jupyter kernel-spec file.
    include("kspec.jl")
    kernelpath = installkernel("Julia", "--project=@.")
end

Thus, if we skip it, exe will not have been defined.

jaantollander commented 1 year ago

I also came across this issue while installing IJulia.jl with IJULIA_NODEFAULTKERNEL flag. I fixed it by moving the include outside the conditional.

include("kspec.jl")

if !haskey(ENV, "IJULIA_NODEFAULTKERNEL")
   # Install Jupyter kernel-spec file.
   kernelpath = installkernel("Julia", "--project=@.")
end
stevengj commented 1 year ago

That change seems fine to me if you want to submit a PR.