PyCintex in ROOT 6

Hello, I guess there is a problem in PyCintex

source root-v6-02-05/bin/thisroot.sh

python
>>> import ROOT
>>> ROOT.gROOT.GetVersion()
'6.02/05'
>>> import PyCintex
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/turra/root-v6-02-05/lib/ROOT.py", line 353, in _importhook
    return _orig_ihook( name, glbls, lcls, fromlist, level )
  File "/usr/lib64/python2.7/site-packages/PyCintex.py", line 29, in <module>
    libPyROOT.MakeRootClass( 'PyROOT::TPyROOTApplication' ).InitCINTMessageCallback()
AttributeError: type object 'PyROOT::TPyROOTApplication' has no attribute 'InitCINTMessageCallback'

as far as I see the method InitCINTMessageCallback does not exist anymore.

Hi,

PyCintex no longer exists in ROOT6, so there must be a mix-up of environments there. (Cintex, i.e. Reflex to CINT mapping is itself gone, as both CINT and Reflex are gone.) Since about ROOT5.34/11 there is a module ‘cppyy.py’, which also exists in compatible form in ROOT6 (same api, but of course no longer on Cintex).

If the origin of cppyy interests you, the name is from here: http://doc.pypy.org/en/latest/cppyy.html and is intented to be compatible.

Cheers,
Wim

thak you, you are right PyCintex is coming from /usr/lib64/python2.7/site-packages/PyCintex.py from a ROOT5 installation.

It should be nice to be able to use ROOT 5 (installed as fedora package) and 6 (manually setup with thisroot.sh) on the same machine.

Here the full Traceback

/home/turra/root-v6-02-05/lib/ROOT.pyc in _importhook(name, glbls, lcls, fromlist, level)
    351          pass
    352    if 5 <= sys.version_info[1]:    # minor
--> 353       return _orig_ihook( name, glbls, lcls, fromlist, level )
    354    return _orig_ihook( name, glbls, lcls, fromlist )
    355 

/usr/lib64/python2.7/site-packages/PyCintex.py in <module>()
     27 
     28 libPyROOT.SetMemoryPolicy( libPyROOT.kMemoryStrict )
---> 29 libPyROOT.MakeRootClass( 'PyROOT::TPyROOTApplication' ).InitCINTMessageCallback()
     30 #--- Enable Autoloading ignoring possible error for the time being
     31 try:    libPyROOT.gInterpreter.EnableAutoLoading()

is line 532 correct? Or do you mean >= ?

[root.cern.ch/phpBB3/viewtopic.p … 931#p76931](Missing Canvas

@wiso: sorry, not following … the import hook is called b/c of the ‘import’ statement. Nothing to do with anything else. Beyond that:[quote=“wiso”]is line 532 correct? Or do you mean >= ?[/quote]which line exactly? My guess is that ‘352’ was meant? If that’s the case, then yes, that code is correct.

(Just to be sure, that ‘5’ in there has nothing to do with ROOT5. Is to do with the ‘5’ in python2.5.)

Cheers,
Wim

[quote=“wlav”]@wiso: sorry, not following … the import hook is called b/c of the ‘import’ statement. Nothing to do with anything else. Beyond that:[quote=“wiso”]is line 532 correct? Or do you mean >= ?[/quote]which line exactly? My guess is that ‘352’ was meant? If that’s the case, then yes, that code is correct.
[/quote]
Sorry, a typo.

[quote]
(Just to be sure, that ‘5’ in there has nothing to do with ROOT5. Is to do with the ‘5’ in python2.5.)

Cheers,
Wim[/quote]

ok.

The point is: why if I setup ROOT6, it tried to import PyCintex from my installation of ROOT 5?

[quote=“wiso”]The point is: why if I setup ROOT6, it tried to import PyCintex from my installation of ROOT 5?[/quote]There is no PyCintex python module in ROOT6, so python will follow the usual places beyond that to find it, and since you have one in a standard system location, that is found.

Compare this to ROOT.py, which is picked up from ROOT6, b/c there is one, and so that one masks the one in the system location, which is never seen.

Cheers,
Wim