I’m doing my darndest to try and use Julia with jupyter as ssh’ing through an iPad is all I have access to. I have finally been able to install Julia and IJulia without precompile errors on the host computer in spite of Julia’s best efforts. But now, when I try to run anything in a notebook, the julia kernel never connects. This is in Julia 1.7.3
This is my install procedure:
conda create -n jul
conda activate jul
conda install jupyterlab julia
then in julia:
]add IJulia
I’ve experimented with Pluto, which I can get working and has the ability to port forward, but I can’t run the Julia tutorials on it so that’s a nonstarter. I would appreciate any help anyone can give.
Edit:
Just tried another thing.
In a fresh environment,
$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.0-linux-x86_64.tar.gz
$ tar -xf julia-1.8.0-linux-x86_64.tar.gz
$ julia-1.8.0/bin/julia
julia> using Pkg
julia> Pkg.add("IJulia")
julia> using IJulia
julia> notebook(detached=true)
julia> run(`$(IJulia.find_jupyter_subcommand("")[1]) notebook list`)
that last line would return a link with a token for me to paste into my browser. All the steps above run fine. I’m even able to start jupyter and get into it. But as soon as I try to open a notebook and connect to a kernel, the kernel fails to connect and gives me an error describing as such, same error I’ve received every time.
The conda-forge version is nice when it works and you have other packages you want to work with in the environment, but if it’s giving you trouble my first recommendation is to see if directly downloading julia from julialang.org will work.
If you can find any logs, output, or anything else giving an error, please share that with us here.
Does it fail explicitly, or does it just keep trying? Is there any output at the console you’re running the Jupyter command from?
If you’ve not tried it already, try a ]build IJulia and see if that reports any errors. Also, I’ve found that installing IJulia in anything other than the base environment @v1.7 can cause issues, so make sure you have it in that environment.
Running jupyter-kernelspec list should give you a list of kernel names and directories. In the directory corresponding to the Julia entry, there will be a kernel.json file. Please paste the contents of that file here.
The errors I get when the kernel fails are something like:
ERROR: LoadError: Failed to precompile IJulia
ERROR: LoadError: Failed to precompile Conda
So far I’ve tried Julia 1.6, 1.7 and 1.8. I’ve tried within a conda environment, and by downloading Julia on its own, tried installing jupyter internally through Conda.add as well as independently with conda in the same conda environment, I’ve tried setting ENV["JUPYTER"]to the path of jupyter in that environment. I’ve tried multiple host computers, all running some version of x86 linux. I’ve reinstalled conda multiple times and cleaned all my environments, I’ve reinstalled Julia, cleaning .cache, .julia, .local, etc. I’m becoming increasingly frustrated by how difficult it has been to get into this language.
We need a full stack trace to understand what is happening. It’s likely that your conda Python configuration is interfering with the Python environment that Julia setup for itself.
Use conda deactivate until you have a normal prompt without “(base)” or any other environment in the prefix.
Also considering moving or removing your current ~/.julia to start fresh.
Then do the following. Notice we are not explicitly installing Jupyter since installing IJulia.jl does that for us.
Running julia /home/aaportel/.julia/packages/IJulia/AQu2H/src/kernel.jl may give some initial hints. Please copy the entire output to here. We can hopefully figure iut what is preventing IJulia from precompiling.
What we are trying to do is to let julia setup it’s own conda environment within ~/.julia/conda This way when you install IJulia it will install exactly the Python packages it needs to function, no more and no less.
My recommedation is to use Julia 1.7 at the moment, simply because we just released 1.8. 1.8 should work but we are just starting to widely deploy it.
Alright. I finally got it to consistently work by downloading 1.7.3 directly from the website, hosting on a different computer, making sure to remove .julia, making sure not to be in any conda environment.
My exact commands are: