I have an issue with magic functions. I downloaded https://app.mybinder.org:80/3517557311/notebooks/notebooks/ROOT_Example.ipynb#
When I execute magic function, I have the following error :
In [1]: %%cpp -d
void f() {
cout << "This is function f" << endl;
}
input_line_38:2:31: error: Unicode character literals may not contain multiple characters
get_ipython().run_cell_magic(u'cpp', u'-d', u'void f() {\n cout << "This is function f" << endl;\n}')
^
input_line_38:2:39: error: Unicode character literals may not contain multiple characters
get_ipython().run_cell_magic(u'cpp', u'-d', u'void f() {\n cout << "This is function f" << endl;\n}')
^
input_line_38:2:46: error: Unicode character literals may not contain multiple characters
get_ipython().run_cell_magic(u'cpp', u'-d', u'void f() {\n cout << "This is function f" << endl;\n}')
^
I have root Release 6.06/02 - 2016-03-03.
ipython v.3.2.0 was installed like this :
sudo pip install -Iv ipython[notebook]==3.2.0
sudo pip install jupyter metakernel zmq
By the way, ipython magic functions works (in ipython):
In [1]: %lsmagic
Out[1]:
Available line magics:
%alias %alias_magic %autocall %autoindent %automagic %bookmark %cat %cd %clear %colors %config %cp %cpaste %debug %dh
...
And this does not work in root.
What I do not understand in the documentation https://root.cern.ch/how/how-use-root-notebook is :
’’ Note that the magics are available in Python notebooks after importing the ROOT module.
…
All integration is triggered by the “import ROOT” statement ‘’
How do you import ROOT ?
In [6]: import ROOT
input_line_43:2:8: error: expected ';' after expression
import ROOT
^
(I have tried %import ROOT)
Regards,
Vincent.