Error when importing ROOT in python3

Dear experts,
I installed ROOT from MacPorts, by sudo port install root6. And when I use python to import the ROOT library, I have the following errors/warnings:

Python 3.7.4 (default, Jul 11 2019, 01:08:00) 
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Error in <TCling::RegisterModule>: cannot find dictionary module libPyROOT_rdict.pcm


Python 2.7.16 (default, Apr  1 2019, 14:50:41)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ROOT

Pythons are installed from MacPorts as well.
Is there any way to fix them?
Many thanks in advance.

_ROOT Version: 6.18
_Platform: macOS mojave, v10.14.6
Compiler: Not Provided

This looks like the same problem as in PyROOT at LXplus, which has been fixed already. Please file a bug with MacPorts for it. It’s most likely a problem related to the fact that libraries and their respective dictionaries must be in the same directory (a new requirement since ROOT 6.18).

Great thanks, amadio! I have filed the bug to MacPorts project.

MacPorts root6 build has been updated to adapt to this new requirement, see

1 Like

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