JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.81k stars 413 forks source link

IJulia in local environment, dead kernel #1021

Closed arifyunando closed 3 years ago

arifyunando commented 3 years ago

Current Outcome: Recently, I freshly installed Julia 1.6.2 in my computer. I made a dedicated environment for a project with Pkg.generate("envName") along with Python venv. After activating python venv and installing jupyter with pip, I open Julia and set environment variable as below:

Those 2 commands set the environment variable to the binaries in the venv folder. After activating environments with Pkg.activate("envName"), I proceed with installing IJulia with Pkg.add("IJulia") within generated TOML file. The installation went normally without any error, and when I run IJulia.notebook(dir="path/to/project"), jupyter notebook opened just fine. However, when I open a notebook with IJulia kernel, it tries to start the kernel for a while and then throws "Dead Kernel" prompts to me.

Expected Outcome : The kernel started successfully and I can use Julia in my notebook.

Action taken : I tried updating IJulia and build it again [Fail], I tried installkernel("Julia", "--project="path/to/project.toml") [Fail]. I also tried to open jupyter notebook directly from cmd (not Julia REPL), and it throws me this message

ERROR: LoadError: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:893
in expression starting at C:\Users\arify\.julia\packages\IJulia\e8kqU\src\kernel.jl:1
[I 11:32:40.564 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:893
in expression starting at C:\Users\arify\.julia\packages\IJulia\e8kqU\src\kernel.jl:1
[I 11:32:43.580 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:893
in expression starting at C:\Users\arify\.julia\packages\IJulia\e8kqU\src\kernel.jl:1
[I 11:32:46.605 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.

Stacktrace:
 [1] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:893
in expression starting at C:\Users\arify\.julia\packages\IJulia\e8kqU\src\kernel.jl:1
[I 11:32:49.613 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.

Possible cause: jupyter notebook doesnt find IJulia in the place project.toml directed, or maybe jupyter notebook doesnt find the project.toml at all

stevengj commented 3 years ago

I made a dedicated environment for a project

IJulia must be installed in the global/default Julia environment, unless you use the IJulia.installkernel function to install a kernel that launches Julia in your environment.