# Thisroot.sh set the wrong path for Jupyter related envs

**URL:** <https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820>\
**Category:** ROOT\
**Tags:** python\
**Created:** [June 27, 2025, 3:39pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820 "2025-06-27T15:39:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdwinYZ](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/edwinyz/32/36503_2.png) [@EdwinYZ](https://root-forum.cern.ch/u/EdwinYZ)\
**Post date:** [June 27, 2025, 3:39pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820/1 "2025-06-27T15:39:44Z")

</div>

In the `thisroot.sh` file, both `JUPYTER_PATH` and `JUPYTER_CONFIG_DIR` are set by:

```shell
   if [-z "${JUPYTER_PATH-}"]; then
      JUPYTER_PATH=$ROOTSYS/etc/notebook; export JUPYTER_PATH # Linux, ELF HP-UX
   else
      JUPYTER_PATH=$ROOTSYS/etc/notebook:$JUPYTER_PATH; export JUPYTER_PATH
   fi

   if [-z "${JUPYTER_CONFIG_DIR-}"]; then
      JUPYTER_CONFIG_DIR=$ROOTSYS/etc/notebook; export JUPYTER_CONFIG_DIR # Linux, ELF HP-UX
   else
      JUPYTER_CONFIG_DIR=$ROOTSYS/etc/notebook:$JUPYTER_CONFIG_DIR; export JUPYTER_CONFIG_DIR
   fi

```

However, in my installation folder, the notebook folder is in `$ROOTSYS/etc/root` folder.

For this reason, when I open up a jupyterlab, I got the following error:

```plaintext
  File "/u/yanwang/miniconda3/bin/jupyter-lab", line 10, in <module>
    sys.exit(main())
             ~~~~ ^^
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_server/extension/application.py", line 616, in launch_instance
    serverapp = cls.initialize_server(argv=args)
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_server/extension/application.py", line 586, in initialize_server
    serverapp.initialize(
    ~~~~~~~~~~~~~~~~~~~~ ^
        argv=argv or [],
        ^^^^^^^^^^^^^^^^
        starter_extension=cls.name,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        find_extensions=find_extensions,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/traitlets/config/application.py", line 118, in inner
    return method(app, *args, **kwargs)
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_server/serverapp.py", line 2784, in initialize
    super().initialize(argv=argv)
    ~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/traitlets/config/application.py", line 118, in inner
    return method(app, *args, **kwargs)
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_core/application.py", line 256, in initialize
    self.migrate_config()
    ~~~~~~~~~~~~~~~~~~~ ^^
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_core/application.py", line 185, in migrate_config
    migrate()
    ~~~~~~~ ^^
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_core/migrate.py", line 242, in migrate
    ensure_dir_exists(env["jupyter_config"])
    ~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^
  File "/u/yanwang/miniconda3/lib/python3.13/site-packages/jupyter_core/utils/ __init__.py", line 26, in ensure_dir_exists
    Path(path).mkdir(parents=True, mode=mode)
    ~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/u/yanwang/miniconda3/lib/python3.13/pathlib/_local.py", line 722, in mkdir
    os.mkdir(self, mode)
    ~~~~~~~~ ^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: '/opt/FairSoft/etc/notebook'

```

_ROOT Version:_ 6.34.08  
_Platform:_ fedora 42  
_Compiler:_ gcc-15

* * *

---

<div class="post-metadata">

**Author:** ![lbreitwi](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/lbreitwi/32/21330_2.png) [@lbreitwi](https://root-forum.cern.ch/u/lbreitwi)\
**Post date:** [June 30, 2025, 5:11pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820/2 "2025-06-30T17:11:23Z")

</div>

Hi @EdwinYZ,

Thank you for your question.  
I just checked our pre-compiled binaries for [v6.36.04 for Fedora 41](https://root.cern/download/root_v6.34.08.Linux-fedora41-x86_64-gcc14.2.tar.gz) and [v6.36.00 for Fedora 42](https://root.cern/download/root_v6.36.00.Linux-fedora42-x86_64-gcc15.1.tar.gz). Both versions have the notebook folder in `$ROOTSYS/etc/notebook`.  
Is there a chance that on your system the folder has been moved by accident?  
If not, could you please provide your cmake invocation?

Best,  
Lukas

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 30, 2025, 5:53pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820/3 "2025-06-30T17:53:43Z")

</div>

```bash
JUPYTER_PATH="$(root-config --etcdir)/notebook${JUPYTER_PATH:+:${JUPYTER_PATH}}"; export JUPYTER_PATH
JUPYTER_CONFIG_DIR="$(root-config --etcdir)/notebook${JUPYTER_CONFIG_DIR:+:${JUPYTER_CONFIG_DIR}}"; export JUPYTER_CONFIG_DIR

```

---

<div class="post-metadata">

**Author:** ![EdwinYZ](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/edwinyz/32/36503_2.png) [@EdwinYZ](https://root-forum.cern.ch/u/EdwinYZ)\
**Post date:** [July 1, 2025, 12:50pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820/4 "2025-07-01T12:50:39Z")

</div>

Thanks for your reply.

You can check the docker container that I’m running on:

```bash
docker pull yanzhaowang/r3bdev:fedora-latest

```

I’m using cmake to install the root, you can see it from this github link:

> <https://github.com/YanzhaoW/FairSoft/blob/15bf9670d8bc5ded9e16abbbba6c290653c491ba/cmake/legacy.cmake#L384C1-L427C1>

---

<div class="post-metadata">

**Author:** ![EdwinYZ](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/edwinyz/32/36503_2.png) [@EdwinYZ](https://root-forum.cern.ch/u/EdwinYZ)\
**Post date:** [July 1, 2025, 12:55pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820/5 "2025-07-01T12:55:22Z")

</div>

Yes, Changing `$ROOTSYS` to `$(root-config --etcdir)` works. Will this change be in the new upcoming versions?

---

<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:** [July 15, 2025, 12:55pm UTC](https://root-forum.cern.ch/t/thisroot-sh-set-the-wrong-path-for-jupyter-related-envs/63820/6 "2025-07-15T12:55:32Z")

</div>

Closed on July 15, 2025, 12:55pm UTC

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