Attempt to install fresh Julia and JupyterLab fails after having had a working set-up

This post relates to using Julia with Jupyter on macOS.

I have previously had the official installed. I have also had JuliaPro versions 1.2 and 1.4 installed. I decided I wanted to use both JupyterLab and the Juno IDE depending on what I was doing. I saw the bloat building in ~/.julia and ~/.juliapro (multiple GB each including stuff that I no longer wanted). I decided to save space and simplify my installation as well as de-link Julia from the Atom-Juno IDE of JuliaPro so that I could upgrade them separately instead of a bundle. I figured it should be possible to (1) install, (2) install JupyterLab, (3) Install Atom with Juno (Julia) extensions, and (4) make Juno use the Julia binary inside

Until yesterday I had working versions of JupyterLab with and JuliaPro 1.2 which I then upgraded to JuliaPro 1.4. That’s when I decided to simply my set-up.

What I did (aka what I screwed up)
After some fussing around I decided to remove all traces of Julia, JuliaPro including Juno, and JupyterLab from my machine and get a fresh start. I dug around the file system and trashed everything I could find. This includes but is not limited to:

  • ~/.julia
  • ~/.juliapro
  • /Applications/
  • /Applications/ or whatever JuliaPro calls their Mac app.
  • Folder julia-1.4 (not sure where that one was)
  • julia.plist
  • Folder Jupyter (not sure where this was either but it contained folder kernels which contained folder julia-1.4, folder nbconvert, and folder runtime.
  • org.julialang.launcherapp.savedState
  • org.julialang.launcherapp.sfl
    (These items and others are currently in my Trash but the Put Back command is disabled for some of them.)

Then I did:

  • I downloaded and put it in /Applications.
  • Started Julia 1.4 in a terminal and installed Conda.jl using the package manager.
  • Installed JupyterLab using Conda.add(“jupyterlab”)
  • Launched JupiterLab using /Users/me/.julia/conda/3/bin/jupyter lab. (This has worked in the past on Julia 1.2 before I broke things.)

What happens now
The notebook launches into a recent version of Firefox as it did in the past. It opens a new untitled tab and presents the Select Kernel dialog with the pop-up to select a kernel. The options are Python 3 or No Kernel. No Julia option. The directory ~/.jupyter has been reconstituted but with less stuff in it compared to the one that I trashed. Also of course is a new ~/.julia.

How do I fix this?
I either want to try again deleting everything and trying another fresh installation but obviously I need to do something different this time, or figure out why JupyterLab is not finding a Julia kernel. Also, I want to continue my effort to later install Atom with the Juno extensions and connect it to the binary inside

It sounds like Julia needs to install itself as a Jupyter kernel. I don’t know where that happened originally, but likely in the Julia or Julia Pro installation? You can find the kernels that Jupyter knows about with jupyter kernelspec list at the command line.

So short answer - my guess is that the answer is best from Julia folks, as they are the ones that install the Julia kernel.

Thanks jasongrout. I think you meant jupyter-kernelspec list

When I run jupyter-kernelspec list it results in command not found. Do I have a path problem?

When I run /Users/me/.julia/conda/3/bin/jupyter-kernelspec list instead I get

python3 /Users/me/.julia/conda/3/share/jupyter/kernels/python3

which includes a file called kernel.json which seems to describe where to find Python 3 along with some some other stuff. I’m pretty sure that the directory in the above path called conda does not exist immediately after installing and running Julia but that it is installed when Conda installs Jupyter so maybe it is a Jupyter problem after all.

If I look in the trashed folder called Jupyter (note the capital J) (which I can’t remember where it came from) I see that it contains a directory structure /blabla/Jupyter/kernels/julia-1.4. So I moved that into /Users/me/.julia/conda/3/share/jupyter/kernels/ and tried starting JupyterLab again.

It opens into the browser and presents a menu that now includes Julia 1.4. Good. But after selecting and waiting I get a series of message dialogs such as Kernel restarting bla bla bla and, in the status bar, Julia 1.4 reconnecting and Julia 1.4 restarting.

In the terminal I see a repeating sequence of lines like this:

ERROR: could not open file /Users/jerrybauck/.julia/packages/IJulia/F1GUo/src/kernel.jl Stacktrace: [1] include(::Module, ::String) at ./Base.jl:377 [2] exec_options(::Base.JLOptions) at ./client.jl:288 [3] _start() at ./client.jl:484 [I 16:22:12.274 LabApp] KernelRestarter: restarting kernel (1/5), keep random ports kernel a968a4cc-6bda-4048-a22c-1b9924bc655a restarted kernel a968a4cc-6bda-4048-a22c-1b9924bc655a restarted kernel a968a4cc-6bda-4048-a22c-1b9924bc655a restarted kernel a968a4cc-6bda-4048-a22c-1b9924bc655a restarted kernel a968a4cc-6bda-4048-a22c-1b9924bc655a restarted kernel a968a4cc-6bda-4048-a22c-1b9924bc655a restarted

So, problem not fixed.

I did
Pkg.add("IJulia") and now things seem to be working correctly.

This step is not described in the installation instructions I was using at
Configuring Julia to work with JupyterLab

So it seems that things are OK now.

It seems to me that the step of adding IJulia should be done by (or included with) either Julia or Jupyter and not left up to the user to discover on his or her own. Is this a recent mistake in the installation process for one of these programs?