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