I’ve downloaded ROOT 6.26.10’s pre-compiled binary for macosxarm64 (the tar file), and was able to run root successfully in terminal. However, when trying to utilize PyROOT by running the import ROOT
command in a python3 shell, I receive the following error:
Traceback (most recent call last):
File "/Users/npolishetty/ROOT/v6.26.10/root/lib/cppyy/__init__.py", line 60, in <module>
importlib.import_module(libcppyy_mod_name)
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libcppyy3_10'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/npolishetty/ROOT/v6.26.10/root/lib/ROOT/__init__.py", line 22, in <module>
import cppyy
File "/Users/npolishetty/ROOT/v6.26.10/root/lib/cppyy/__init__.py", line 62, in <module>
raise ImportError(
ImportError: Failed to import libcppyy3_10. Please check that ROOT has been built for Python 3.10
Yes, I know there is a post with a very similar title and issue. The reason I’m making my own post for this is because there are a few key differences.
- I installed my ROOT from cern’s website directly, rather than using MacPorts or another package installer, and
- My Python and ROOT versions aren’t the same. When checking python’s version, I get 3.10.9, but when checking root’s python3 version, I get 3.9.6. I’m confused as to why they are in conflict, as shouldn’t ROOT 6.26.10 be more than able to handle 3.10? If it can’t, I’d be more than happy to downgrade to Python 3.9.6, but I can’t shake the feeling something’s off…
ROOT Version: 6.26.10
Platform: macosxarm64 / macOS Ventura (13.2.1)
Compiler: Precompiled binary distribution from root.cern