Libcppyy3_8 in Python3.8 on lxplus7

ROOT Version: 6.24/06
Platform: lxplus7
Compiler: Python 3.8.12

Hello, I’m using lxplus7 virtual machine and tried to import ROOT inside python environment as follows:

[mgiza@lxplus717 scripts]$ python
Python 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
  File "/cvmfs/", line 60, in <module>
  File "/cvmfs/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libcppyy3_8'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/cvmfs/", line 22, in <module>
    import cppyy
  File "/cvmfs/", line 62, in <module>
    raise ImportError(
ImportError: Failed to import libcppyy3_8. Please check that ROOT has been built for Python 3.8

The “import ROOT” is a part of my script that I want to run in ROOT 6.24 due to several dependencies on other associated packages.

Running “root-config --features” gives me:

cxx11 asimage builtin_afterimage builtin_clang builtin_cling builtin_davix builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_lzma builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_unuran builtin_vdt builtin_veccore builtin_xrootd builtin_xxhash builtin_zlib clad dataframe davix exceptions fftw3 fitsio fortran gdml http imt mathmore mlp minuit2 mysql opengl pgsql pyroot roofit runtime_cxxmodules shadowpw shared soversion sqlite ssl tmva tmva-cpu tmva-pymva spectrum unuran vmc vdt veccore x11 xml xrootd

Moreover I checked:

[mgiza@lxplus717 scripts]$ root-config --has-python

Now, I would like to ask what is the correct way to deal with this problem on lxplus7? Should I rebuild ROOT in one of my directories?


[mgiza@lxplus775 scripts]$ root-config --has-pyroot
[mgiza@lxplus775 scripts]$  root-config --python3-version
[mgiza@lxplus775 scripts]$ python3.6

I’m sourcing the ROOT 6.24/6 via:

source /cvmfs/

The error persists nevertheless

1 Like

In your first post, you seem to be mixing python coming from conda with ROOT coming from lcg. I don’t think this will work. You need to use python provided by the operating system (same for the compiler and all libraries).