Import ROOT results in dead kernel of pyhton 2.7 jupyter notebook


_ROOT Version:6.13/02
_Platform: Mac OS
Compiler: Not Provided


Hello,

I downloaded ROOT in late March and have been using it with no problems. I have just downloaded Anaconda with python 2.7 and I am trying to use a python 2.7 jupyter notebook. When I try to import ROOT it results in a dead kernal. I have tried opening the notebook using both jupyter notebook and root --notebook and both result in the same outcome. I am not sure how to proceed.

Hi,

it really looks like a typical python installation issue. Are you sure that the python ran in the kernel is the same against which you compiled ROOT?

Cheers,
D

Hi,

I have only just downloaded anaconda so I think it must be different. How do I change this and where is the python that compiles root? Thank you for your quick response!

Hi,

so, are you sure that downloading anaconda was the cause?
You could try at the python shell where “import ROOT” works see where the module, say, os is installed and do the same from a notebook, of course w/o importing ROOT, to see if there are indeed two installations around.

Cheers,
D

Hello,

I am not sure if downloading anaconda was the cause, but before that I couldn’t have used jupyter notebooks so I wouldn’t have known there was an issue.

import ROOT does not seem to work in a python shell either, I get the following error:
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

I am very sorry, but how do I check where the os module is installed in the shell or a notebook?

Shall I delete ROOT and reinstall it to see if it uses the python I downloaded as part of anaconda?

The error above is an indication that you are running a different version of Python than the one ROOT was compiled for (e.g. Python 2.x vs 3.x).

Hello, thank you for the help so far. I have tried using python 3 instead of python 2 and now I have a different error:

ImportError: dynamic module does not define module export function (PyInit_libPyROOT)

Which is supposedly from the line:

import libPyROOT as _backend

in the file lib/cppyy.py

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