Search code examples
pythonroot-frameworkpyrootrootpy

ROOTpy plotting example not working


I'm trying to run the example on how to plot ROOT histograms via matplotlib from the rootpy documentation.

This results in a rather vague error:

import rootpy.plotting.root2matplotlib as rplt
  File "/Users/pigard/ROOT/install/lib/ROOT.py", line 301, in _importhook
return _orig_ihook( name, *args, **kwds )
  File "/usr/local/lib/python2.7/site-packages/rootpy/plotting/__init__.py", line 12, in <module>
from .hist import Hist, Hist1D, Hist2D, Hist3D, Efficiency, HistStack, histogram
  File "/Users/pigard/ROOT/install/lib/ROOT.py", line 301, in _importhook
return _orig_ihook( name, *args, **kwds )
  File "/usr/local/lib/python2.7/site-packages/rootpy/plotting/hist.py", line 2251, in <module>
snake_case_methods(cls)
  File "/usr/local/lib/python2.7/site-packages/rootpy/decorators.py", line 143, in snake_case_methods
members = inspect.getmembers(root_base)
  File "/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/inspect.py", line 253, in getmembers
value = getattr(object, key)
SystemError: error return without exception set

I'm running on OS X 10.10 with ROOT6. One thing that seems a bit bizarre to me is the reference to /usr/local/Cellar/ in the last line of the stack trace, whereas the previous lines refer to /usr/local/lib/.

However, I do not experience any other problems with running pyROOT so it doesn't look like an issue of wrong libraries to me.


Solution

  • Try using a newer tag of ROOT6. I had the same problem and reported it to the ROOT developers and it was fixed:

    https://sft.its.cern.ch/jira/browse/ROOT-7336