ImportError: No module named rootpy.tree


I am trying to run a simple script in python and I get this error:

ImportError: No module named rootpy.tree

I have this in my code:
import ROOT
from rootpy.tree import TreeChain
from sys import argv

Any advice how to solve this? (addtion to the original post: I already have rootpy installed)


rootpy doesn’t come with ROOT.
You have to install it from

Oh, I see. Thanks a lot!

Sorry I misread that yesterday. I do have rootpy installed!

ok, so…

  • on which platform/OS are you?
  • where and how did you install it? which version?
  • with which python VM ? (py2, py3) (do you have multiple python installations?)
  • is there a python VM where this:
    import rootpy
    works? (and if it does, what does print(rootpy.__file__) show?)
  • what’s your $PYTHONPATH ?
  • MAC OSX 10.7.5
  • I installed it a while ago via macports, the python version is 2.7.1
  • $PYTHONPATH is /usr/bin/python

I have run some scripts before, but this particular one uses rootpy.tree (from rootpy.tree import TreeChain))and this seems to be the problem…

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