I’m running the container from docker://rootproject/root:6.26.10-fedora36,
but I want to use pyroot in this container. I can’t find the file thisroot.sh anywhere. I read this forum thread, but none of the locations discussed contained the file. I don’t know where the build directory is. I can only find the root executable /usr/bin/root .
ROOT Version: v6-26-10 Platform: Fedora Compiler: Not Provided
I do not have the $ROOTSYS variable set. Or rather, it is the same as on my computer, so it points to a different root, not the one in the container. But I cannot find a directory that contains those things.
I am using singularity for the container rather than docker if that is important
Yes ROOTSYS is defined when you run thisroot.sh. I just wanted to mean ROOT being the “place where root is installed”. Are you sure ROOT is installed on this machine? what do you get when you run /usr/bin/root ?
ROOT is definitely installed. I can run it and it is version 6.26.10 which is different from the installation outside the container. I am new to containers, so I just don’t know where to find the “installation directory” for ROOT when I’m in the container. What is the default path for this directory with a new container from the rootproject dockerhub?
which root gives /usr/bin/root. The directory /usr/bin does not contain thisroot.sh. It contains other executables like rootls and rootssh, but is not a ROOT “build directory” that I would have if I installed ROOT myself.
OK, I think I’ve figured it out. If I run the shell using sudo, I can import ROOT in python because it has the appropriate ROOT stuff in the python site-packages/. It wasn’t working when I ran the shell without sudo because it wasn’t setting $PYTHONPATH (discussed here). I can just set $PYTHONPATH directly and don’t need to source thisroot.sh (which I’m fairly certain does not exit in my container).
It would be nice to have a thisroot.sh to source to easily make use of ROOT if I set up different python environments, but I guess I can always just add a link to /usr/lib64/python__/site-packages/ROOT in the site-packages folder for my other environment.
TL;DR: There was really never a problem. I thought there was because I was searching for thisroot.sh (which I couldn’t find because it isn’t there), but what I fundamentally needed was ROOT/__init__.py which was always there in site-packages/ ; I was just not looking for it!