I have been trying to get pyROOT to work on my Mac (Ventura 13.6.7). Frustratingly, when I enter the python prompt by typing python3
then import ROOT
I get some errors.
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 10:14:12) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
/Volumes/Macintosh HD/Applications/root_v6.30.04/lib/cppyy/__init__.py:72: SyntaxWarning: invalid escape sequence '\d'
if re.match('^libcppyy_backend\d+_\d+$', lib_name):
Traceback (most recent call last):
File "/Volumes/Macintosh HD/Applications/root_v6.30.04/lib/cppyy/__init__.py", line 60, in <module>
importlib.import_module(libcppyy_mod_name)
File "/Users/benluke/anaconda3/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libcppyy3_12'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Volumes/Macintosh HD/Applications/root_v6.30.04/lib/ROOT/__init__.py", line 25, in <module>
import cppyy
File "/Volumes/Macintosh HD/Applications/root_v6.30.04/lib/cppyy/__init__.py", line 62, in <module>
raise ImportError(
ImportError: Failed to import libcppyy3_12. Please check that ROOT has been built for Python 3.12
There have been several similar posts on the ROOT forum but none of their solutions have worked in my case. For reference, I am using ROOT 6.30.04, Xcode 15.2, and command line tools 15.1. Can anyone offer some wisdom?