# ROOT's kernel does not appear in Jupyter (macOs)

**URL:** <https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171>\
**Category:** Newbie\
**Tags:** python, root, jupyter\
**Created:** [January 18, 2023, 9:58pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171 "2023-01-18T21:58:52Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 18, 2023, 9:58pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/1 "2023-01-18T21:58:52Z")

</div>

Hello everyone,

I kind of new with ROOT but I need it for a class and my teacher has never seen this kind of problem (which seems not new here) , root is functional for me in my terminal it works, python also recognizes it but Jupyter notebooks and Jupyter-lab won’t. I’ve seen the different previous topics here on this forum but none of them worked for me.  
I’m a newbie and I don’t really know what to do, so if anyone has any ideas on what I should do I’ll be grateful !

Best regards,

Louis

\_ROOT Version: 6.26/06  
\_Platform: MacOs  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [January 19, 2023, 11:47am UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/2 "2023-01-19T11:47:10Z")

</div>

Hi @Louis_phys,

> [@Louis\_phys](#):
>
> root is functional for me in my terminal it works, python also recognizes it but Jupyter notebooks and Jupyter-lab won’t.

How are you spawning Jupyter notebook? The most straightforward way is to do

```bash
$ root --notebook

```

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:01pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/3 "2023-01-19T12:01:17Z")

</div>

Thanks for your answer, yes I also tried this but here is what I get:

 ![error-pyroot](https://root-forum.cern.ch/uploads/default/original/3X/1/1/1125123d96800b5e45a3f41b2ffbb116dd2803fb.png)

Ps usually I either use the `jupyter-lab` command or` jupyter notebook` one in my terminal.

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [January 19, 2023, 12:06pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/4 "2023-01-19T12:06:00Z")

</div>

Could you confirm that importing the ROOT module in a standalone Python session as in

```bash
$ python
>>> import ROOT
>>>

```

works?

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/5 "2023-01-19T12:07:18Z")

</div>

Yes it works, to be even clearer , whenever I copy the code from a `.ipynb` into a` .py` file and run it and it works perfectly that’s what is really weird…

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [January 19, 2023, 12:08pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/6 "2023-01-19T12:08:29Z")

</div>

Which Python version are you using when it works (on the command line)?

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:09pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/7 "2023-01-19T12:09:24Z")

</div>

This is Python 3.10.9

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:12pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/8 "2023-01-19T12:12:08Z")

</div>

Ps: I tried to uninstall Jupyter and reinstall it (through homebrew and pip3), I’ve done the same thing for root (with brew) and I was thinking of doing the same thing for python but I’m not sure this would help.

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [January 19, 2023, 12:18pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/9 "2023-01-19T12:18:21Z")

</div>

> [@Louis\_phys](#):
>
> This is Python 3.10.9

That’s the issue. The ROOT distribution that you are using was built for Python 3.10 (and hence it works on the command line). However, your installation of Jupyter notebook seems to be using Python 3.9, which tries to load the corresponding module for that version (`libcppyy3_9`), which fails.

The easiest solution I can think of is to use Conda to install a ROOT distribution together with Jupyter that use the same Python version. Please, take a look at [Installing ROOT - ROOT](https://root.cern/install/#conda) for instructions.

Maybe @vpadulan or @etejedor know of any other better/faster workaround.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [January 19, 2023, 12:21pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/10 "2023-01-19T12:21:38Z")

</div>

Very weird that `root --notebook` still spawns a jupyter instance with a different Python version than the one used to install ROOT. In any case, I have nothing to add, your environment should be coherent and have the same Python version for all packages you use (irrespectively of ROOT tbh).

If conda is too slow, try using [mamba](https://mamba.readthedocs.io/en/latest/index.html) as a faster alternative.  
Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:30pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/11 "2023-01-19T12:30:07Z")

</div>

Okay thanks so what should I do exactly ? Uninstall python and reinstall it with mamba ?

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:32pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/12 "2023-01-19T12:32:58Z")

</div>

There are no other ways to have the Jupyter version that is linked with python 3.10 ?

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [January 19, 2023, 12:35pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/13 "2023-01-19T12:35:58Z")

</div>

Hi @Louis_phys,

Here’s a small self-contained example of how to setup a working conda environment with mamba (you can add `jupyter` in the `mamba create` line:

> [@ROOT build with Python 3.7 in centos7](https://root-forum.cern.ch/t/root-build-with-python-3-7-in-centos7/53162/8):
>
> Hi, conda is notoriously slow. I find myself much better when using [mamba](https://mamba.readthedocs.io/en/latest/index.html). It’s the same as using conda, but much faster. I suggest you read the docs, but the following steps should already give you a minimal working environment (taken from [here](https://github.com/conda-forge/miniforge#unix-like-platforms)): curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" bash Mambaforge-$(uname)-$(uname -m).sh # The bash script will install mamba into a folder of your choice # For simplicity, in the follo…

As for other ways, I would suppose reinstalling Jupyter in the same Python environment of your ROOT installation should fix the issue. I don’t know the brew command for it. If you install ROOT via brew, I suppose you should also install Jupyter via the same command and not mix it with other Python executables

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![Louis\_phys](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecae2f/32.png) [@Louis\_phys](https://root-forum.cern.ch/u/Louis_phys)\
**Post date:** [January 19, 2023, 12:41pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/14 "2023-01-19T12:41:15Z")

</div>

Okay thanks, yes I think that I’ll need to look on how to properly uninstall everything from jupyter and reinstall it properly with brew even if I already tried it but it seems like I’ve done it wrong.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [February 2, 2023, 12:41pm UTC](https://root-forum.cern.ch/t/roots-kernel-does-not-appear-in-jupyter-macos/53171/15 "2023-02-02T12:41:23Z")

</div>

Closed on February 2, 2023, 12:41pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
