ModuleNotFoundError: No module named 'ROOT._pythonization._tmva._batchgenerator'

Hello ROOT experts,
I’m having some problems when importing Root on Python. I have built Root on lxplus to match with the Python version of the environment that I’m using. Therefor there is not a problem with compatibility.

root-config --python-version

However when opening the Python compiler and giving the command import ROOT, it’s giving me this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/afs/", line 39, in <module>
  File "/afs/", line 302, in _register_pythonizations
    importlib.import_module(__name__ + '.' + module_name)
  File "/cvmfs/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/afs/", line 27, in <module>
    from ._batchgenerator import (
ModuleNotFoundError: No module named 'ROOT._pythonization._tmva._batchgenerator'

_ROOT Version: 6.32.02
_Platform: lxplus alma9
_Compiler: -

Thank you in advance for your advice.
Have a nice day.

Hi Michaela,

Thanks for the post and welcome to the ROOT Community!

I am sorry to read you have to overcome these technical hurdles due to Python versions of your stack and lxplus.

Are you sure you configured ROOT with all necessary options ("-D"s)? Could you paste here the summary of the cmake invocation in your build directory (“cmake .”)?



In case you want to compile on lxplus, which can be a painful exercise, you can always do it from the /tmp/ directory, to avoid to use afs which is a good product, but not adequate for compilation (slow).

Hi Danilo,
since I don’t have R installed and Roofit was giving me issues, I used this configuration:

cmake -DCMAKE_INSTALL_PREFIX=../root_install -Ddataframe=OFF -Droofit=OFF ../root_src


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.