# Preferred Kernel in jupyter notebook

**URL:** https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138
**Category:** General Usage
**Tags:** question, jupyter, julia
**Created:** [July 27, 2023, 2:00am UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138 "2023-07-27T02:00:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [July 27, 2023, 2:00am UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138/1 "2023-07-27T02:00:25Z")

</div>

I have used three different versions of Julia on my PC (1.8.5, 1.9.0, and 1.9.2). For all versions, I’ve already installed the IJulia package or using `Pkg` and `Pkg.build("IJulia")`. However, when I use the jupyter notebook, there are just Julia versions 1.8.5 and 1.9.0. is there a limit in the number of Kernel Julia in jupyter notebook?  
If not, how could I use all versions of Julia on jupyter notebook?  
Thank you all.

---

<div class="post-metadata">

### Author: ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)
#### Post date: [July 27, 2023, 7:22am UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138/2 "2023-07-27T07:22:03Z")

</div>

There should be no limit on the number of kernels.

What might cause the problem is that the default name for the kernel spec is `julia-1.X` for each minor version, so probably one kernel spec got overridden when you installed the second 1.9 kernel.

You can manually install another kernel with `installkernel` (also useful if you want to have a different kernel with multithreading etc.)

```julia
using IJulia

# Let's say this is in the 1.9.0 environment
installkernel("Julia-legacy")

```

and then install the latest version normally with `pkg> build`. Here is more info  
[https://julialang.github.io/IJulia.jl/dev/manual/installation/#Installing-additional-Julia-kernels](https://julialang.github.io/IJulia.jl/dev/manual/installation/#Installing-additional-Julia-kernels)

You can also check if the kernels are pointing to the correct locations of the Julia executable by inspecting the paths returned from

```julia
shell> jupyter kernelspec list

```

In the folder corresponding to the listed kernel spec, there should be a `kernel.json` which contains the path to the Julia executable.

PS: `IJulia` (or jupyter?) seems to always append the full version number to the kernel name displayed in Jupyter (at least Jupyter lab). Not a problem, but it looks a bit silly if the name is `Julia 1.9.0 1.9.0`, so I chose a different name in the example 😅

---

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [July 27, 2023, 1:12pm UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138/3 "2023-07-27T13:12:52Z")

</div>

I tried to use installkernel to create a new kernel from the REPL of Julia version 1.9.2, but the result has a path as follows:

```julia
jupyter\\kernels\\julia-1.9.2-1.9

```

julia-1.9.2 is the name of the kernel that I intend to create and - 1.9 is the version of the kernel. I am not sure whether there are the correct versions for the kernel I want to create or not. Because if I tried to create two new kernels with names 1.9.2 and 1.9.0 both of them have the same extension -1.9 at the end of the path.

---

<div class="post-metadata">

### Author: ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)
#### Post date: [July 27, 2023, 2:54pm UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138/4 "2023-07-27T14:54:16Z")

</div>

As long as the name is different (`julia-1.9.2-1.9` and `julia-1.9.0-1.9` or just `julia-1.9`) everything should work.

If you want to be absolutely sure, you can run `versioninfo()` in a Jupyter notebook with the two different kernels and check what their versions are.

---

<div class="post-metadata">

### Author: ![Ethan\_Tran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethan_tran/32/49198_2.png) [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)
#### Post date: [July 27, 2023, 3:01pm UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138/5 "2023-07-27T15:01:25Z")

</div>

Thank you for your help.

---

<div class="post-metadata">

### Author: ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)
#### Post date: [July 27, 2023, 4:20pm UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138/6 "2023-07-27T16:20:18Z")

</div>

I’m glad it’s working!

Jupyter can be a bit fickle sometimes 😁
