# rootlogon.C not picked up by Jupyter C++ Notebooks

**URL:** <https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562>\
**Category:** ROOT\
**Tags:** jupyter\
**Created:** [October 29, 2019, 2:13pm UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562 "2019-10-29T14:13:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahesam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahesam/32/19455_2.png) [@ahesam](https://root-forum.cern.ch/u/ahesam)\
**Post date:** [October 29, 2019, 2:13pm UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/1 "2019-10-29T14:13:54Z")

</div>

Hello,

In a directory with a `rootlogon.C`, Jupyter notebook does not seem to execute the commands specified inside that file. Opening a ROOT interactive session, on the other hand, does pick the rootlogon.C. Is there a way to make this work for Jupyter Notebooks? It would be nice to hide away calls like `R__LOAD_LIBRARY(libmylib)`.

Cheers,  
Ahmad

* * *

_ROOT Version:_ v6.18/04  
_Platform:_ Ubuntu 16.04  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [October 30, 2019, 7:11am UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/2 "2019-10-30T07:11:37Z")

</div>

Hi,

Are you using a C++ notebook or a Python notebook?

Cheers,

Enric

---

<div class="post-metadata">

**Author:** ![ahesam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahesam/32/19455_2.png) [@ahesam](https://root-forum.cern.ch/u/ahesam)\
**Post date:** [October 30, 2019, 8:03am UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/3 "2019-10-30T08:03:59Z")

</div>

As mentioned in the title, a C++ Notebook 😉

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [October 30, 2019, 1:31pm UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/4 "2019-10-30T13:31:52Z")

</div>

Indeed right now `rootlogon.C` is not automatically loaded from a notebook. The reason is that the ROOT C++ kernel is actually implemented in Python, which takes what you write in the cell and forwards it as a string to the ROOT interpreter for execution. The C++ kernel does not currently make sure rootlogon.C is executed as the ROOT prompt does.

As a workaround, you can do from the first cell of your C++ notebook:

```auto
gROOT->LoadMacro("/path/to/rootlogon.C");

```

---

<div class="post-metadata">

**Author:** ![ahesam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahesam/32/19455_2.png) [@ahesam](https://root-forum.cern.ch/u/ahesam)\
**Post date:** [October 30, 2019, 2:11pm UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/5 "2019-10-30T14:11:40Z")

</div>

Thanks, this works. Is there maybe a way to hide even this command? For example, I know there are some ROOT settings in `$ROOTSYS/etc` that are automatically loaded. I actually don’t want users to write this line for every notebook that they create. I had hoped that ROOT notebooks somehow searches through the current working directory and some other standard directories to look for a rootlogon.C and load it (as you’d expect they would be loaded in the rootcling interactive shell).

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [October 31, 2019, 8:34am UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/6 "2019-10-31T08:34:41Z")

</div>

Hi,  
I opened a ticket with your request, you can follow it here:  
[https://sft.its.cern.ch/jira/browse/ROOT-10385](https://sft.its.cern.ch/jira/browse/ROOT-10385)

Cheers,  
Enric

---

<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:** [November 14, 2019, 8:39am UTC](https://root-forum.cern.ch/t/rootlogon-c-not-picked-up-by-jupyter-c-notebooks/36562/7 "2019-11-14T08:39:09Z")

</div>

Closed on November 14, 2019, 8:39am UTC

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