Thisroot.sh set the wrong path for Jupyter related envs

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

   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:

  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


Hi @EdwinYZ,

Thank you for your question.
I just checked our pre-compiled binaries for v6.36.04 for Fedora 41 and v6.36.00 for Fedora 42. 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

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

Thanks for your reply.

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

docker pull yanzhaowang/r3bdev:fedora-latest

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

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

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