Problems with PyROOT with anaconda3 python 3.6

Hi,

I installed my ROOT v06.08 using the anaconda3 python compiler (python v3.6.1). However I have 2 different issues.

Whenever I import ROOT in a python code, using:

from ROOT import *

I get a break segmentation issue related to this (got it through gdb):

Thread 1 “python” received signal SIGSEGV, Segmentation fault.
0x00007fffef8f4a7b in (anonymous namespace)::RootLookDictString (mp=0x7ffff7f48fc0, key=0x7fffefdec2f0, hash=4378576883871306534,
value_addr=0x7fffffffd9d0) at /home/lsantos/Downloads/root-6.08.06/bindings/pyroot/src/RootModule.cxx:259
259 if ( ! ep || (ep->me_key && ep->me_value) || gDictLookupActive )

On the other topic (I think they are not related), whenever I call PyROOT on Jupyter Notebook I get this error whatever the way I call ROOT:


ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 from ROOT import *

/home/lsantos/root6/lib/ROOT.py in ()
586 ip = get_ipython()
587 if hasattr(ip,“kernel”):
–> 588 import JupyROOT
589 import JsMVA
590

/home/lsantos/root6/lib/ROOT.py in _importhook(name, *args, **kwds)
301 except Exception:
302 pass
–> 303 return _orig_ihook( name, *args, **kwds )
304
305 builtin.import = _importhook

/home/lsantos/root6/lib/JupyROOT/init.py in ()
----> 1 import JupyROOT.utils
2
3 if ‘IPYTHON’ in builtins and IPYTHON:
4 utils.iPythonize()

/home/lsantos/root6/lib/ROOT.py in _importhook(name, *args, **kwds)
301 except Exception:
302 pass
–> 303 return _orig_ihook( name, *args, **kwds )
304
305 builtin.import = _importhook

/home/lsantos/root6/lib/JupyROOT/utils.py in ()
15 import re
16 import fnmatch
—> 17 import handlers
18 import time
19 from hashlib import sha1

/home/lsantos/root6/lib/ROOT.py in _importhook(name, *args, **kwds)
301 except Exception:
302 pass
–> 303 return _orig_ihook( name, *args, **kwds )
304
305 builtin.import = _importhook

ModuleNotFoundError: No module named ‘handlers’

Any help would be appreciated,

Cheers,

Lucas

Dear Lucas,

Have you tried to use import ROOT rather than from ROOT import *?
I am afraid that importing the whole of ROOT into the global namespace could cause conflicts with existing functionality.

For the second one, it looks like you may have a configuration problem with Python. Maybe setting an appropriate PYTHONPATH could take care of that.

Hi Guilherme,

Thanks, if I import only some classes like from ROOT import TH1F, TF1… it works fine.

About the PYTHONPATH, it points to here: /home/lsantos/root6/lib. My python is located, here: [lsantos@localhost ~]$ which python
~/anaconda3/bin/python

How can I point out to the appropriate path?

Hi Lucas,

If you have PYTHONPATH pointing to your ROOT installation, then it should work.
Both import ROOT and from ROOT import * work fine for me with python 3.5.3.
I will test with python 3.6 and file a JIRA issue if I see any problems there. For now,
you may want to downgrade your python version if you can, while this is sorted out.

I will have a look at JupyROOT after installing ipython on my system.

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