# Change default IJulia kernel associated to a notebook

**URL:** <https://discourse.julialang.org/t/change-default-ijulia-kernel-associated-to-a-notebook/94055>\
**Category:** New to Julia\
**Tags:** ijulia, kernel, notebooks\
**Created:** [February 4, 2023, 5:37pm UTC](https://discourse.julialang.org/t/change-default-ijulia-kernel-associated-to-a-notebook/94055 "2023-02-04T17:37:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mocalvao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mocalvao/32/19318_2.png) [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Post date:** [February 4, 2023, 5:37pm UTC](https://discourse.julialang.org/t/change-default-ijulia-kernel-associated-to-a-notebook/94055/1 "2023-02-04T17:37:21Z")

</div>

Hi there

I cloned the git repo [rethinking.jl](https://github.com/Shmuma/rethinking-2ed-julia) for the Statistical Rethinking, 2nd. ed. book, in order to follow along with its notebooks. My currrent version of Julia is 1.8.3, but I still have older ones (such as 1.6.2, for instance). My problem is when I issue:

`julia> using IJulia; notebook(detached=true)`

and then select one of the notebooks from the cloned repo, it is automatiicaly opened with the 1.6.2 kernel, instead of the 1.8.3 I would like. Is there a way to tell IJulia (for good) to open it (and any other notebooks, for that matter) always with the newest available kernel? I thought I might achieve this by editing either the `Project.toml` or `Manifest.Toml` files, but the ones downloaded did not seem to have any direct reference to the Julia version…

Thanks in advance

PS: in hindsight, I thought of deleting the .toml files from the cloned repo, running the commands `generate` and `activate`, and then adding all the used packages from scratch, but there should be a more direct way…

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 5, 2023, 1:29am UTC](https://discourse.julialang.org/t/change-default-ijulia-kernel-associated-to-a-notebook/94055/2 "2023-02-05T01:29:58Z")

</div>

The kernel name is stored in the notebook file itself. Opening the notebook, switching kernels, and saving should be sufficient.

(If you open the notebook in a text editor you should be able to easily see where the kernel info is stored. The JSON format is human readable.)

---

<div class="post-metadata">

**Author:** ![mocalvao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mocalvao/32/19318_2.png) [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Post date:** [February 5, 2023, 11:26am UTC](https://discourse.julialang.org/t/change-default-ijulia-kernel-associated-to-a-notebook/94055/3 "2023-02-05T11:26:20Z")

</div>

@stevengj I followed your suggestion and it seems to have worked. Thank you!

Just for future reference, I would like to add some more specific piece of information:

- I checked what were the jupyter kernels I had installed, via the command

```julia
jupyter kernelspec list

```

- then, as suggested by @stevengj, I checked that, in my concrete notebook, the relevant data were at its end (as opened via a usual text editor, e.g., emacs) and I changed all occurrences of 1.6.2 to 1.8.3 so as they now read:

````julia
"metadata": {
  "kernelspec": {
   "display_name": "Julia 1.8.3",
   "language": "julia",
   "name": "julia-1.8"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "1.8.3"
  }
 }```
````
