I am testing for the first time the nice idea of ROOTaaS. I have installed ROOT v6.07/02, python 2.7.11, jupyter 4.0.6, Mozilla Iceweasel 44.0 on Debian sid.
I followed the instructions https://root.cern.ch/how/how-create-rootbook and started as
Then, I open a Python2 notebook, make a simple test, that works perfectly:
[code]In [1]: import ROOT
Welcome to JupyROOT 6.07/02
In [2]:
%%cpp
TFile* aFile = TFile::Open(“u100.root”);
aFile->ls();
TFile** u100.root
TFile* u100.root
KEY: TTree data;5 read from binary file
KEY: TMacro u100-p0008;1 console.log[/code]
I try then the C++ Kernel directly, and write just this.
TFile* aFile = TFile::Open("u100.root");
aFile->ls();
This does not work. It seems that I missed something, because I get the following error printed in the terminal (not in the notebook):
root --notebook
[I 17:32:38.833 NotebookApp] Serving notebooks from local directory: /home/MED/ferhue
[I 17:32:38.834 NotebookApp] 0 active kernels
[I 17:32:38.834 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 17:32:38.834 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 17:32:44.195 NotebookApp] Kernel started: 05971c39-1039-4cbf-b5a8-0727b692b7e5
[C 17:32:51.151 NotebookApp] Malformed message: ['<IDS|MSG>', '6b071c5a030d7cf0b65b640c9295f52d437f3a443de728cdec359284ece37b8e', '{"username":"ferhue","msg_type":"stream","msg_id":"a9507291-9721-499f-89d1-105bfbfb442e","version":"5.0","session":"111a00c1-f7a9-4927-ac97-2bc379f092ed","date":"2016-02-08T17:32:51.146912"}', '{"username":"username","version":"5.0","msg_type":"execute_request","msg_id":"211BFFAC3DC04FA884C67B93EC3E69DD","session":"4FEAC7B1148F48C2870E85F54A71BD28","date":"2016-02-08T17:32:50.920828"}', '{}', '{"text":"X\\\\Z\xaf\\u0004\x7f","name":"stdout"}']
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/notebook/base/zmqhandlers.py", line 249, in _on_zmq_reply
msg = self._reserialize_reply(msg_list, channel=channel)
File "/usr/local/lib/python2.7/dist-packages/notebook/base/zmqhandlers.py", line 230, in _reserialize_reply
msg = self.session.deserialize(msg_list)
File "/usr/local/lib/python2.7/dist-packages/jupyter_client/session.py", line 859, in deserialize
message['content'] = self.unpack(msg_list[4])
File "/usr/local/lib/python2.7/dist-packages/jupyter_client/session.py", line 97, in <lambda>
json_unpacker = lambda s: jsonapi.loads(s)
File "/usr/local/lib/python2.7/dist-packages/zmq/utils/jsonapi.py", line 56, in loads
return jsonmod.loads(s, **kwargs)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xaf in position 1: invalid start byte
It seems that stdout as well as stderr are not correctly redirected by zmq to the notebook. Maybe my python or jupyter version is too old? I would appreciate any hint. I found this, maybe it helps:
https://github.com/JuliaLang/ZMQ.jl/issues/73
Thanks, and congratulations for this new feature and all your work.