# I cannot use Julia kernel in Jupyter Notebook/Jupyter lab after updating to Julia 1.9.0

**URL:** https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649
**Category:** Visualization
**Created:** [May 31, 2023, 7:12am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649 "2023-05-31T07:12:50Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [May 31, 2023, 7:12am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/1 "2023-05-31T07:12:50Z")

</div>

I have installed Jupyter Lab, and IJulia. Now if I do  
`$ jupyter lab`,  
I get to see the Jupyter Lab web interface, where

if I select “Julia-1.9.0 kernel”, the kernel does not load, and in the terminal I see the following message:

// — error message

> "[Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]  
> ERROR: LoadError: ArgumentError: Package Preferences [21216c6a-2e73-6563-6e65-726566657250] is required but does not seem to be installed:

- Run `Pkg.instantiate()` to install all recorded dependencies.  
—//

Running `Pkg.instantiate()` does not result in any error message but it does not help to solve the problem.

I have checked and the Package `Preferences` is installed.

Jupyter Notebook/Lab Julie kernel is now unusable.

Julia works otherwise.  
What am I doing wrongly and how can I solve this problem?  
Would greatly appreciate a solution.

Best,  
Arindam Basu

---

<div class="post-metadata">

### Author: ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)
#### Post date: [May 31, 2023, 8:45am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/2 "2023-05-31T08:45:22Z")

</div>

What version of IJulia are you running?

What happens if you run lab through IJulia, e.g.

```julia
using IJulia
jupyterlab()

```

---

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [May 31, 2023, 9:47am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/3 "2023-05-31T09:47:53Z")

</div>

It doesn’t connect if run with `using IJulia; jupyterlab()`.  
It spawns jupyterlab interface but the kernel does not connect.

---

<div class="post-metadata">

### Author: ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)
#### Post date: [May 31, 2023, 11:06am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/4 "2023-05-31T11:06:12Z")

</div>

Have you check the [install instructions](https://julialang.github.io/IJulia.jl/stable/manual/installation/#Installing-IJulia) for IJulia? There are some notes on stuff you should think of when using separate jupyter installations (not sure if you do this?) or if you update Julia/IJulia.

Maybe just try to reinstall or rebuild IJulia, and make sure the kernelspec is appropriately updated?

---

<div class="post-metadata">

### Author: ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)
#### Post date: [May 31, 2023, 11:14am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/5 "2023-05-31T11:14:51Z")

</div>

I have encountered a similar problem only in notebook. I couldn’t fix the error, but I started using jupyter notebook in visual code. In this case, everything worked.  
Errors in my case:

```julia
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\web.py", line 1704, in _execute
    result = await result
  File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 328, in __wakeup
    future.result()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 769, in run
    yielded = self.gen.throw(*exc_info) # type: ignore
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 74, in post
    model = yield maybe_future(
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 762, in run
    value = future.result()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 769, in run
    yielded = self.gen.throw(*exc_info) # type: ignore
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 98, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 762, in run
    value = future.result()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 769, in run
    yielded = self.gen.throw(*exc_info) # type: ignore
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 110, in start_kernel_for_session
    kernel_id = yield maybe_future(
  File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 762, in run
    value = future.result()
  File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 201, in result
    raise self._exception
  File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 256, in __step
    result = coro.send(None)
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 176, in start_kernel
    kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
  File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 186, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 341, in start_kernel
    self.kernel = self._launch_kernel(kernel_cmd, **kw)
  File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 249, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\launcher.py", line 132, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The specified file cannot be found

```

---

<div class="post-metadata">

### Author: ![math4mad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math4mad/32/49486_2.png) [@math4mad](https://discourse.julialang.org/u/math4mad)
#### Post date: [May 31, 2023, 5:24pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/6 "2023-05-31T17:24:39Z")

</div>

I don’t know how to use Jupyter note directly , because I use Quarto qmd, but I think same problem

Problem is: maybe you delete old version Julia, but you don’t delete old version kernel in Python env.

Firstly I solved this problem in Quarto note by add `Jupyter=Julia 1.9` .  
then, I find another way follow this link :[list jupyter kernel and delete kernel](https://queirozf.com/entries/jupyter-kernels-how-to-add-change-remove) . So I delete old jupyter kernel, just keep the newest one. after delete old kernel ,like this:

```julia
$jupyter kernelspec remove julia-1.8

$ jupyter kernelspec list
Available kernels:
  julia-1.9 /Users/lunarcheung/Library/Jupyter/kernels/julia-1.9
  python3 /Users/lunarcheung/Library/Jupyter/kernels/python3

```

maybe another way to change default kernel , but I can’t find this way at now.

---

<div class="post-metadata">

### Author: ![math4mad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math4mad/32/49486_2.png) [@math4mad](https://discourse.julialang.org/u/math4mad)
#### Post date: [May 31, 2023, 5:28pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/7 "2023-05-31T17:28:34Z")

</div>

```julia
using IJulia; 
notebook() 

```

---

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [May 31, 2023, 9:10pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/8 "2023-05-31T21:10:09Z")

</div>

Yes, I followed every instruction in IJulia.  
I completely uninstalled (that is, removed the .julia folder and every trace of Julia in my computer) and then reinstalled Julia. Then I installed IJulia with `Pkg.add("IJulia"); Pkg.build("IJulia"); Pkg.instantiate(); Pkg.resolve()` (many of these steps are unnecessary but I did them anyway!!)  
I completely removed Anaconda from my computer and then reinstalled Mambaforge following the instructions. I removed every trace of Conda/Anaconda/Mamba from my computer including references in ~/.zshrc and then reinstalled everything. Then I installed julia in mamba in an environment and in that environment I installed IJulia.

Nothing helped.  
If I were to fire up `jupyter lab` and selected the Julia-1.9.0 kernel within the Jupyter Lab, it would not start! Each time it reported “Preferenes is required but not found” which is not true because Preferences package is installed. Despite Zeromq, Zeromq\_jll, and JLL packages installed, it would not precompile and it did not work.  
I never faced this problem ever before.  
Strangely enough, as @Sergey_Novak has written, I had the same experience. I can use jupyter notebook from VSCode but not from a web browser.

What more do I need to do?

---

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [May 31, 2023, 9:12pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/9 "2023-05-31T21:12:14Z")

</div>

I have had the same experience.  
If I use file.ipynb in VSCode, and set Julia Release Channel, things work as they should and no issues.  
`IJulia` does not seem to work if I use it in the context of a web browser based implementation of Jupyter Notebook. On the Jupyter Notebook, all other kernels work as usual.

---

<div class="post-metadata">

### Author: ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)
#### Post date: [May 31, 2023, 9:20pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/10 "2023-05-31T21:20:15Z")

</div>

Do you use the built in kernel in vscode, or the same kernel as in the browser?

Can you check the kernel spec file an see if there is anything strange added there?

---

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [June 1, 2023, 3:45am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/11 "2023-06-01T03:45:13Z")

</div>

I am sure I am using the built in kernel of the VScode, and there is nothing unusual in the the output of Jupyter kernelspec list.  
This problem is unique to the MacBook I use.

---

<div class="post-metadata">

### Author: ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)
#### Post date: [June 1, 2023, 4:29am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/12 "2023-06-01T04:29:51Z")

</div>

But if you use the built in kernel in vscode, and that works, doesn’t that make it seem like it could be a problem with the kernel?  
Can you try the other kernel in vscode, the one you tried in the browser?

---

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [June 1, 2023, 5:05am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/13 "2023-06-01T05:05:50Z")

</div>

Yes, it IS the julia kernel that is the problem.  
When I used the Julia-1.9.0 kernel in the VSCode, it did not work and showed the same error messages.  
What is the solution?

---

<div class="post-metadata">

### Author: ![arinbasu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arinbasu/32/581_2.png) [@arinbasu](https://discourse.julialang.org/u/arinbasu)
#### Post date: [June 1, 2023, 5:27am UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/14 "2023-06-01T05:27:18Z")

</div>

Thanks @albheim  
OK, it seems that if I do:

```julia
using IJulia
installkernel("Julia nodeps", "--depwarn=no")

```

then start jupyter and select Julia-1.9.0-nodeps, it runs as it should.

---

<div class="post-metadata">

### Author: ![danspielman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danspielman/32/4708_2.png) [@danspielman](https://discourse.julialang.org/u/danspielman)
#### Post date: [August 19, 2023, 4:07pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/15 "2023-08-19T16:07:10Z")

</div>

I’ve had the same problem with Julia 1.9.2 on an Intel based Mac Pro (aka cheese grater).  
This solution of installing the kernel with depwarn=no seems to solve the problem.

But, I suspect this is going to be an obstacle for many people. I’ve had trouble getting Julia 1.9 working with Jupyter on 3 machines.

---

<div class="post-metadata">

### Author: ![drmartinrohde](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@drmartinrohde](https://discourse.julialang.org/u/drmartinrohde)
#### Post date: [April 10, 2024, 3:46pm UTC](https://discourse.julialang.org/t/i-cannot-use-julia-kernel-in-jupyter-notebook-jupyter-lab-after-updating-to-julia-1-9-0/99649/16 "2024-04-10T15:46:19Z")

</div>

Still is a problem when upgrading to Julia 1.10.2. But the trick by @arinbasu works.
