# ROOT 6.28 and Jupyter not Draw-ing \[SOLVED\]

**URL:** <https://root-forum.cern.ch/t/root-6-28-and-jupyter-not-draw-ing-solved/54862>\
**Category:** ROOT\
**Tags:** jupyter\
**Created:** [May 15, 2023, 7:55pm UTC](https://root-forum.cern.ch/t/root-6-28-and-jupyter-not-draw-ing-solved/54862 "2023-05-15T19:55:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seligman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@seligman](https://root-forum.cern.ch/u/seligman)\
**Post date:** [May 15, 2023, 7:55pm UTC](https://root-forum.cern.ch/t/root-6-28-and-jupyter-not-draw-ing-solved/54862/1 "2023-05-15T19:55:57Z")

</div>

Before I get into details, I’ll ask the basic question that might lead me to the answer: What is the component within ROOT and Jupyter that causes images to be displayed on a notebook page?

The issue in more detail:

I have a working JupyterHub installation running C++ and Python kernels with ROOT 6.26 under AlmaLinux 9.1. The purpose of the installation to make these kernels available for the students at our lab.

In order to provide my users with the latest and greatest, I tried updating the software framework with:

```
dnf -y update root\*

```

The results made me glad that I put the installation on a virtual machine so I could fall back to an earlier instance. When ROOT was updated to 6.28, it introduced a flaw in Jupyter: When I try to `Draw` something that puts actual graphics on the web page, the ROOT kernel (whether C++ or Python) dies. What’s more, it does so without leaving any form of error message in `/var/log/messages` or anywhere else that I’ve been able to locate.

For example:

```auto
TH1D hist("example","example",100,-3,3);
hist.FillRandom("gaus",10000);
hist.Draw();
c1->Draw();

```

In my 6.28.02 Jupyter installation, the kernel will die on the fourth line.

- This issue does not occur in my ROOT 6.26 installation. That works fine.

- This is not a problem with ROOT itself. If I run ROOT via the command line, or run `ipython` and type similar commands, the plot is displayed. It’s only an issue if I try to `Draw` from within Jupyter.

- The issue is located in my JupyterHub installation somewhere. I confirmed this by creating a Docker container with AlmaLinux 9 and ROOT 6.28/02 (`wgseligman/jupyter-pyroot:latest-amd64`, or `wgseligman/jupyter-pyroot:latest-arm64` if you’re using an M1/M2 Mac). The issue does not occur within that container.

- I’ve done more than just `dnf -y install root\*` as I attempted to assess the issue. I updated everything in the system with `dnf -y update`; I updated all the pip packages including:

- My jupyterhub installation is complex, since it includes more than just the C++ and Python ROOT kernels. I’d father not have to rebuild it from scratch.

My conclusion is that there’s some piece of the Jupyter installation that I did not upgrade properly. However, without any error messages, I can’t determine what it is.

This leads back to my initial question: What part of ROOT+Jupyter actually puts images into the Jupyter notebook page? If I at least knew that, perhaps I could track down what’s going wrong.

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ 6.28.02  
_Platform:_ AlmaLinux 9  
_Compiler:_ gcc 11.3.1

* * *

---

<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:** [May 16, 2023, 8:58am UTC](https://root-forum.cern.ch/t/root-6-28-and-jupyter-not-draw-ing-solved/54862/2 "2023-05-16T08:58:44Z")

</div>

Dear @seligman ,

That’s an interesting problem, indeed I tried with ROOT 6.28, 6.28/02 and master on my machine and the jupyter notebook does properly show the graphics. The graphics should be shown via traditional ROOT graphics (TCanvas & friends), unless you are using JsROOT (with the `%jsroot on` magic in the notebook cell), which injects some javascript to make the graphics interactive, which needs `TBufferJSON` to work properly (so the `-Dhttp=ON` flag when building, but you are installing via dnf so that should not be an issue). If you haven’t done it already, you could try outputting the debug information from the notebook via something like `jupyter notebook --debug > log.file 2>&1`.

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![seligman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@seligman](https://root-forum.cern.ch/u/seligman)\
**Post date:** [May 16, 2023, 12:09pm UTC](https://root-forum.cern.ch/t/root-6-28-and-jupyter-not-draw-ing-solved/54862/3 "2023-05-16T12:09:41Z")

</div>

I solved the problem. Of course, the issue was where I least expected it.

I kept running tests, and discovered that sometimes I could execute `Draw`, and other times `Draw` would hang. I finally found a correlation: The `.ipynb` would draw correctly except when it was located in one specific directory. That directory was the one in which I kept my ROOT tutorial files.

I concluded that there was a “poisoned file” in that directory that caused the failure. After a “binary search”, I found the culprit: It was a `.so` file that I created years ago and paid no attention to. Evidently this old file, compiled using whatever ROOT version was current in 2015, is no longer compatible with ROOT 6.28. Go figure!

I deleted the .so file, and I could draw things again. I regenerated the `.so` file using the script I first created in 2015, and I could still draw things.

An idle question: Why would the presence of this old file cause a problem with ROOT? I could understand a problem if I were loading the library by default in `rootlogon.C`, but I was not. There must be some aspect of ROOT 6.28 that was not in ROOT 6.26 where it’s scanning its current directory looking for `.so` files. Does anyone know what that could be?

---

<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:** [May 30, 2023, 12:10pm UTC](https://root-forum.cern.ch/t/root-6-28-and-jupyter-not-draw-ing-solved/54862/4 "2023-05-30T12:10:39Z")

</div>

Closed on May 30, 2023, 12:10pm UTC

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