Jupyter julia notebook on Amazon AWS SageMaker

I want to run a Jupyter notebook in Amazon SageMaker with a Julia kernel. There is very little documentation about this. There is this:

I followed all the instructions, and Julia shows up in the JupyterLab launcher; but when I run it, Julia 1.17.1 shows up as the kernel and then dies. It appears to be trying, but then gives up and says “No Kernel” instead of “Julia 1.17.1” in the status line.

If I run the R kernel, all goes well. If I run the Julia kernel (which shows up in the list of available kernels!), I get the following error message:

Connection failed 
A connection to the notebook server could not be established. 
The notebook will continue trying to reconnect. 
Check your network connection or notebook server configuration.

When I run a terminal, I cannot run julia straight away. I have to do

source activate
conda activate julia

first, then I can run julia. If I shut down the terminal and start a new one, I have to do this again or julia won’t run. It would make sense that this is the issue for JupyterLab as well: that it tries to run julia but it won’t initialize conda first.

1 Like

If an existing Project.toml file is not found then, by default, an IJulia notebook will try to run a Julia kernel with its active project set from the global or default environment (usually of the form ~/.julia/environments/v1.x).

If the IJulia package is not installed in that environment, then the Julia kernel selected by default will not be able to connect, and a Connection failed error will be displayed. In this case, users should install a additional Julia kernel that uses their chosen Julia environment.
For example, if the desired environment is currently activated in the REPL then one possibility is to execute

IJulia.installkernel("Julia MyProjectEnv", "--project=$(Base.active_project())")

and subsequently select the kernel starting with Julia MyProjectEnv from Kernel > Change Kernel in the menu of the Jupyter notebook.

1 Like

Reopening this thread…

Following the PDF above, I’ve managed to get a Julia (1.8.4) notebook to work on SageMaker.=
However, I’m getting the following from Plotly:

The WebIO Jupyter extension was not detected. See the WebIO Jupyter integration documentation for more information.

However, seems that the WebIO extension is installed:

(julia) sh-4.2$ jupyter labextension list
JupyterLab v3.3.2
        jupyterlab-plotly v5.6.0 enabled OK
        nbdime-jupyterlab v2.1.1 enabled OK
        webio-jupyterlab-provider v0.1.0 enabled OK (python, webio_jupyter_extension)
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /home/ec2-user/anaconda3/share/jupyter/lab

What am I doing wrong?