You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tutorial does not start but prints a backtrace:
Traceback (most recent call last):
File "/home/jakob/Documents/CERN/ROOT/ntuple/install-git/tutorials/pyroot/numberEntry.py", line 51, in <module>
window = pMyMainFrame( gClient.GetRoot(), 50, 50 )
File "/home/jakob/Documents/CERN/ROOT/ntuple/install-git/tutorials/pyroot/numberEntry.py", line 25, in __init__
self.fLabelDispatch = TPyDispatcher( self.DoSetlabel )
NameError: name 'TPyDispatcher' is not defined
Expected behavior
The tutorial should run
To Reproduce
cd $ROOTSYS/tutorials/pyroot
python -i numberEntry.py
vpadulan@fedorathinkpad-T550 [~]: python
Python 3.8.7 (default, Jan 20 2021, 00:00:00)
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> ROOT.TPyDispatcher
<class cppyy.gbl.TPyDispatcher at 0x55b264067990>
But in the tutorial numberEntry.py the ROOT objects are imported via from ROOT import * which somehow doesn't import TPyDispatcher in the python session. Indeed, changing that line with import ROOT and then explicitly instantiating ROOT.TPyDispatcher solves this issue
Now in general from <package> import * is discouraged so I would change the tutorial, but it is true that ROOT also has its own machinery to decide which names are imported into the namespace in this case and I still don't know why TPyDispatcher is not loaded along all the other classes
Describe the bug
The tutorial does not start but prints a backtrace:
Expected behavior
The tutorial should run
To Reproduce
Setup
Compiled from latest ROOT sources / Arch Linux
Additional context
See ROOT forum
The text was updated successfully, but these errors were encountered: