# Root on jupyter notebook does not plot graphics in C++

**URL:** <https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149>\
**Category:** ROOT\
**Tags:** jupyter\
**Created:** [March 20, 2023, 9:01pm UTC](https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149 "2023-03-20T21:01:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckaraf](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cab0a1/32.png) [@ckaraf](https://root-forum.cern.ch/u/ckaraf)\
**Post date:** [March 20, 2023, 9:01pm UTC](https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149/1 "2023-03-20T21:01:21Z")

</div>

Dear all,  
I am trying to use ROOT through a jubyter notebook in C++, however it does not plot any graphics, although it creates the object. Any ideas?

I have compiled root 6.26.10 with python 3.8.10  
I used gcc 9.4.0  
I have download JsRoot730 and provided the directory to CMAKE\_INSTALL\_JSROOTDIR (however I am not sure if this is the correct procedure).  
My system is Ubuntu 20.04

Thank you in advance,  
Costas

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [March 20, 2023, 9:56pm UTC](https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149/2 "2023-03-20T21:56:32Z")

</div>

Hi Costas,

You do not need to install JSROOT extra - it is provided with ROOT already.  
Also for ROOT 6.26 base JSROOT version is 6.3 - versions 7 may not work.

If after plain ROOT compilation JSROOT graphics in jupyter notebook does not work - please check output in browser console (activated with Ctrl-Shift-I)

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![ckaraf](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cab0a1/32.png) [@ckaraf](https://root-forum.cern.ch/u/ckaraf)\
**Post date:** [March 21, 2023, 4:18pm UTC](https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149/3 "2023-03-21T16:18:45Z")

</div>

Hi Sergey,

Thank you for your reply. I have compiled again root without the external JSROOT package.

Also I tried to run it through a conda environment, but the graphics still do not display.  
The error message in the browser console is as follows:  
“Failed to fetch ipywidgets through the “jupyter.widget.control” comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early”

However, ipywidgets is installed as you can see below:  
jupyter --version

Selected Jupyter core packages…  
IPython : 8.10.0  
ipykernel : 6.19.2  
ipywidgets : 8.0.4  
jupyter\_client : 7.4.9  
jupyter\_core : 5.2.0  
jupyter\_server : 1.23.4  
jupyterlab : 3.5.3  
nbclient : 0.5.13  
nbconvert : 6.5.4  
nbformat : 5.7.0  
notebook : 6.5.2  
qtconsole : 5.4.0  
traitlets : 5.7.1

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [March 22, 2023, 8:00am UTC](https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149/4 "2023-03-22T08:00:54Z")

</div>

Hi Costas,

It is definitely some configuration problems of `jupyter`.  
Are you using `jupyter lab` or `jupyter notebook`?

I have a cases when some widgets from jupyter tutorials (not ROOT) were working with notebook, but not working with `lab`.  
Try both to see difference.

Regards,  
Sergey

---

<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:** [April 5, 2023, 8:01am UTC](https://root-forum.cern.ch/t/root-on-jupyter-notebook-does-not-plot-graphics-in-c/54149/5 "2023-04-05T08:01:22Z")

</div>

Closed on April 5, 2023, 8:01am UTC

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