Julia 1.3 and IJulia -- how to find Julia 1.3 as kernel?

I just removed Julia 1.2 and installed Julia 1.3 + renamed v1.2 to v1.3 in .julia\environments + did ]instantiate and updated packages.

When I fire up IJulia, Julia 1.2 shows up as the only available kernel (together with Python 3).

How can I:

  • make Julia 1.3 available as kernel, and
  • remove Julia 1.2 as available kernel

] build IJulia

6 Likes

for the first one just type from a julia 1.3 prompt:

] add IJulia
build IJulia

For removing the old kernel I woult have fist removed the IJulia package from the 1.2 Julia before removing Julia. As you have already removed Julia 1.2, try from Julia 1.3 to remove the IJulia package (] rm IJulia) before adding it.

EDIT: The solution from @baggepinnen should suffix

2 Likes

Following your advice, both kernels Julia 1.2 and Julia 1.3 are available. (I’d like to remove Julia 1.2 from the pop-up menu, though).

However, when I choose Julia 1.3, I get the following error message:

Error Starting Kernel
Traceback (most recent call last):
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\web.py", line 1699, in _execute
    result = await result
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
    type=mtype))
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\tornado\gen.py", line 209, in wrapper
    yielded = next(result)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
    **kw)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "C:\Users\user_name\.julia\conda\3\lib\site-packages\jupyter_client\launcher.py", line 138, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:\Users\user_name\.julia\conda\3\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\user_name\.julia\conda\3\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Do using IJulia; IJulia.kerneldir() which will tell you the location of all of Jupyter’s kernel-specification files. You can simply delete any you don’t want.

In particular, you can remove the Julia 1.2 kernelspec with

using IJulia
rm(joinpath(IJulia.kerneldir(), "julia-1.2"), recursive=true)

A FileNotFoundError from Python usually means that you moved Julia after installing the kernel specification, so that Jupyter now doesn’t know where to find julia.exe. Re-run build IJulia in Julia 1.3.

1 Like

It’s probably better to just use jupyter kernelspec remove julia-1.2 instead.

Edit: Although I guess that doesn’t work when julia installs its own private jupyter via Conda.jl.

1 Like

I used IJulia.kerneldir() and deleted the Julia 1.2 kernel manually. Next, I did ]build IJulia, and now it seems to work.

Thanks!

I’m having the same problem and am completely stuck. I had some old notebooks for Julia 1.1. I erased 1.1 a few months ago and am now on 1.4.1. The old notebooks can’t find the new kernel. The new notebooks ( created wiht Julia 1.4.1 ) work fine. I did

  1. update and build IJulia
  2. use IJulia.kerneldir and deleted the 1.1 kernel
  3. changed the kernel to 1.4.1 in the pulldown menu
  4. did ]rm IJulia; add IJulia; build IJulia

I’m getting “Kernel starting please wait” for a while. Then the notebook briefly says that I’m connected, but then I see a popup that says

Connection failed: a connection could not be established …

I don’t know enough about python to mess with conda. What should I do now?

I’m running a Mac with the latest OS. This is a personal device, so there are no firewall issues.

Erased .julia and started over. Problem solved!

Any idea why I had to do this?

1 Like

You can use this Colab notebook template which supports any Julia version (from 0.7.0 to the latest).

FYI, here’s how it works: the kernel specified in the .ipynb file is named “julia”. After installing IJulia, the code renames the kernel from “julia-<specific version>” to “julia”. That’s it.

Hope this helps.