ROOT ignores LD_LIBRARY_PATH when imported in ipython

I am seeing a strange behaviour difference when in import ROOT in python vs doing it in an ipython terminal. Specifically, I have some custom paths in my LD_LIBRARY_PATH environment variable. If I open a python interactive session and do:

>>> import ROOT
>>> ROOT.gSystem.GetDynamicPath()

I see my paths listed. But if instead I open an ipython terminal and do:

In [1]: import ROOT
In [2]: ROOT.gSystem.GetDynamicPath()

My custom paths are missing!?

I cannot figure out why I would get a different behaviour of ROOT when I import it in python vs in ipython? Any idea?

This is 6.22/08 and python 3.9.5 on a mac, in case it is important info.

Only thing I can think of: ipython comes from something like a conda environment or similar rather than the system, and decides to shield the environment from the outside env.

hmmm. I installed ipython with brew, but yes it does seem for some reason that ipython wants to hide environment variables. E.g. if I set LD_LIBRARY_PATH in my environment, opening ipython and doing os.environ["LD_LIBRARY_PATH"] fails, but it works and is correct in python.

So I guess this isn’t a ROOT-specific issue but frustratingly some googling hasn’t thrown up how to fix this ipython issue.

Thanks
Will

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