Mac M1 Architecture Issue

_ROOT Version: v6-13-0
_Platform: macOS Monterey, 12.2
Compiler: Not Provided


Hi! Very new to ROOT and trying to get it up and running with pyroot. At the current time, I can fire up python and root from my terminal, and on their own these programs have no issues. The problem comes up when I try and run import ROOT directly in python or in a python code. I get the following error;

>>> import ROOT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Applications/root/lib/ROOT.py", line 24, in <module>
    import cppyy
  File "/Applications/root/lib/cppyy.py", line 61, in <module>
    import libPyROOT as _backend
ImportError: dlopen(/Applications/root/lib/libPyROOT.so, 0x0002): tried: '/Applications/root/lib/libPyROOT.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libPyROOT.so' (no such file)

I’m regrettably not the best with computer structures, and this seems to be a new-ish issue so there were only a handful of message board questions I could follow along with(none of which helped). Any suggestions here?

Found a solution ! Thought I’d share if anyone else comes across this problem. I just needed to manually change my architecture from arm64e to x86_64 with the code
arch -x86_64 zsh

1 Like