Unable to import ROOT after Monterey 12.3.1 update

Dear all,

After updating my Mac OS to Monterey 12.3.1, I am unable to load ROOT in my python scripts. I checked that the ROOT is working fine. Python is also working fine and is present at following paths–
which root
/usr/local/root/obj/bin/root

which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

But somehow my script is reading ROOT at -
/System/Library/Frameworks/Python.framework/Versions/2.7/Python

and giving the following error –

import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/root/obj/lib/ROOT.py”, line 24, in
import cppyy
File “/usr/local/root/obj/lib/cppyy.py”, line 61, in
import libPyROOT as _backend
ImportError: dlopen(/usr/local/root/obj/lib/libPyROOT.so, 0x0002): Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python
Referenced from: /usr/local/root/obj/lib/libPyROOT.so
Reason: tried: ‘/System/Library/Frameworks/Python.framework/Versions/2.7/Python’ (no such file)

– Paths in my bash_profile are –

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:PATH" eval "(pyenv init --path)"

eval “$(pyenv init -)”

export PYTHONPATH=$PYTHONPATH:/usr/local/root/obj/lib
export ROOTSYS=/usr/local/root/obj
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH


I am wondering if anybody is facing the same problem. Please help me to resolve this issue.

Thanks,

Amandeep Kaur

Hi @Amey ,
this is a common problem with MacOS updates. You probably have to uninstall and reinstall ROOT (Installing ROOT - ROOT).

You can also search the forum for similar problems.

Cheers,
Enrico

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