I am trying to use PYROOT with jupyter.
Using Anaconda 2.7 python (as my ROOT installation apparently was not built with p3 and I would get the ImportError: dynamic module does not define module export function (PyInit_libPyROOT)
error).
Initially import ROOT would produce no module found, then I added
. /usr/local/Cellar/root6/6.06.08/libexec/thisroot.sh to bash_profile, and now the kernel dies.
Can anyone help?
Edit: console message
Fatal Python error: PyThreadState_Get: no current thread
[I 12:35:01.315 NotebookApp] KernelRestarter: restarting kernel (1/5)
WARNING:root:kernel 69d4c78f-69d3-4389-ab25-9ac863cc45d9 restarted
I would like to use jupyter (and PyRoot), however I am very begginer in this bussiness. And your answer is not much satisfying.
1/ I followed web and I have found that anaconda is highly recommended method for jupyter, I did it, I have localy python and jupyter and it is great
2/ I have installed 6.08.06 / removed PATH with local anaconda / and I can run example from https://root.cern.ch/pyroot and some of the things from tutorial/pyroot
3/ Without anaconda in PATH, I dont have jupyter, with anaconda in PATH I cannot run demo.py
What is the real solution? Where to find a correct steps for install?
Thank you
Jaromir
I think the best method to install Jupyter or any python package really depends on your taste and configuration. What I can say regarding ROOT and Jupyter is that both python2 and 3 are supported starting from release 6.09/02 - just note that the binaries which we distribute are based on Python2.
I am somehow on a wrong track, I must miss some basic context, something with libstdc++.so and I need a hint…
Is there possible to have anaconda3 from continuum.io installed and root 6 on top of that?
How do people who use Jupyter notebooks exactly install root6?
Thanks
J
My experiences: 1 - No anaconda: I have compiled 6.09.02 now (without anaconda in PATH), and I cannot run a notebook.
~ $ rootnb.exe
Error starting ROOT notebook -- please check that Jupyter is installed
2 - Afterparty anaconda If I include anaconda to PATH after the compilation, I can run Jupyter. But it crashes when I start rootc++ kernel due to different libstdc++.so problem
[NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel 641088db-a4d4-40fc-912f-80b7441271d8 restarted
Traceback (most recent call last):
File "/home/ojr/anaconda3/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
....
ImportError: /home/ojr/anaconda3/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/ojr/02_GIT/root.build/lib/libPyROOT.so)
3 - Compilation with anaconda If I include anaconda in PATH and start a new compilation of 6.09.02. That fails - the libstdc++.so again.
[ 67%] Generating G__MultiProc.cxx, ../../lib/libMultiProc_rdict.pcm, ../../lib/libMultiProc.rootmap
[ 67%] Generating G__HistFactory.cxx, ../../lib/libHistFactory_rdict.pcm, ../../lib/libHistFactory.rootmap
/home/ojr/02_GIT/root.build/bin/rootcling: /home/ojr/anaconda3/lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/ojr/02_GIT/root.build/lib/libRIO.so)
.....
I don’t know if you can anaconda3 and root6 installed on top of it. We do not test this combination in our CI platforms.
I remember I installed jupyter with pip3 (both on ubuntu and osx) and it worked out fine.
About 3, somehow the libstdc++ takes precedence with respect to the one used to build part of ROOT. There could be effects linked to an inconsistent build (part of root with one libstdc++ part with some other).
Thank you.
I removed anaconda3 things and I can do basically the same with python3 that comes with ubuntu 16.04, including Jupyter. Thank you again.
But - I still have a problem. I have installed jupyter, metakernel, development version of root 6.09.02 - based on instructions https://github.com/root-project/root/tree/master/bindings/pyroot/JupyROOT . I can run jupyter notebook or rootnb.exe, but at the moment I start root c++ kernel, it makes an error.
Most probably I missed something, import ROOT and simple example in python3 works. The path inthe list is root.build, but when I do source thisroot.sh it becomes correct ~/root/with the same result. Any advice is appreciated.
Kernel started: 3d51cfe3-ef77-4d36-8600-5aa0ae74fd60
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/home/ojr/02_GIT/root.build/lib/JupyROOT/__init__.py", line 1, in <module>
from JupyROOT import cppcompleter, utils
File "/home/ojr/02_GIT/root.build/lib/JupyROOT/cppcompleter.py", line 8, in <module>
from JupyROOT import utils
File "/home/ojr/02_GIT/root.build/lib/JupyROOT/utils.py", line 25, in <module>
import ROOT
File "/home/ojr/02_GIT/root.build/lib/ROOT.py", line 24, in <module>
import cppyy
File "/home/ojr/02_GIT/root.build/lib/cppyy.py", line 61, in <module>
import libPyROOT as _backend
ImportError: dynamic module does not define module export function (PyInit_libPyROOT)
Oh. Really, import ROOT works with python but not with python3. So this was a point.
Following this answer http://stackoverflow.com/a/37857536/2324000 I managed to have python2 and python 3 kernels. However, no influence on the previous error. Maybe I dont know how to start jupyter of python2.
Now, I think, what you mean by your question. I would like to have root built with python3, it is going to be a future soon. I have no idea what could I do, though… Could you tell me more? Thank you
Jaromir Edit: I see now that python3 was a topic Feb 2016 … Jupyter Notebook with python3 (Python3.4) and ROOT
and there is probably a way Problem using ROOT with jupyter notebook
in order to build with python3 enabled, just add the -Dpython3=ON option at configuration time. Before, just make sure to have both python3 and the related development files available (e.g. Python.h).
I’ve just started to use Python and Jupyter and I would like to create a ROOTBook in order to combine Jupyter and ROOT. Therefore, I followed the instructions that can be found on several pages (installed Python 2.7 and ROOT6), but when I try to import ROOT in my ROOTBook I get the following error message: