Can not import ROOT from PYTHON

Hi,

for an analysis I need to import the “root_numpy” library in my script, but when I launch it, the module ROOT can not be found. Do you know the reason of it? Is there a library path I should export?

N.B.: I use ROOT 5.34 and Python 2.7

Thanks for your help!

I’m trying to install the same module using these instructions.
https://rootpy.github.io/root_numpy/install.html

Do you have numpy installed already? As for me, I get an error when doing this inside the git cloned root_numpy directory.

sudo ROOTSYS=$ROOTSYS python setup.py install

Error:

/Users/up/Downloads/build/include/Rtypes.h:37:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

So I’m also curious from any answers from those with more experience here.

I could solve it:

I had to reinstall ROOT and pay attention that when configuring ROOT the flag --enable-python is set.

Reload ROOT

Then reinstall root_numpy using :
sudo ROOTSYS=$ROOTSYS python setup.py install

Did you use cmake or ./configure?
I did cmake --enable-python and built with clang but I get this error still after sudo ROOTSYS=$ROOTSYS python setup.py install

/Users/up/Downloads/rootbuild/include/Rtypes.h:37:10: fatal error: 'atomic' file not found #include <atomic> ^ 1 warning and 1 error generated. error: command '/usr/bin/clang' failed with exit status 1

I have made it with ./configure

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