Skip to content

Recent merge to master breaks Python extension. #18967

@greenc-FNAL

Description

@greenc-FNAL

Check duplicate issues.

  • Checked for duplicates

Description

After the merge of 7bfa486, importing ROOT into Python fails with:

[greenc@scisoftbuild02] ROOT (fnal-develop) (spack) $ python3
Python 3.12.9 (main, Jun  3 2025, 16:57:49) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/scratch/greenc/art-develop-2025-06-03/spack_env/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack/linux-x86_64_v2/root-develop-ctadxqh3t46bnlepnswftm6vsm566bho/lib/root/ROOT/__init__.py", line 46, in <module>
    from ._pythonization import _register_pythonizations
  File "/scratch/greenc/art-develop-2025-06-03/spack_env/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack/linux-x86_64_v2/root-develop-ctadxqh3t46bnlepnswftm6vsm566bho/lib/root/ROOT/_pythonization/__init__.py", line 17, in <module>
    from ._generic import pythonize_generic
  File "/scratch/greenc/art-develop-2025-06-03/spack_env/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack/linux-x86_64_v2/root-develop-ctadxqh3t46bnlepnswftm6vsm566bho/lib/root/ROOT/_pythonization/_generic.py", line 11, in <module>
    from ROOT.libROOTPythonizations import AddPrettyPrintingPyz
ImportError: libTree.so.6.37: cannot open shared object file: No such file or directory

Prior to this commit, import ROOT is successful.

Looking a little closer, it appears that lib/ROOT/libROOTPythonizations.so has the following relevant RPATH entries:

$ORIGIN
$ORIGIN/../lib/root

when perhaps a more suitable RPATH would include:

$ORIGIN
$ORIGIN/..

Reproducer

After setting PYTHONPATH appropriately, execute:

python3 -m ROOT

ROOT version

   ------------------------------------------------------------------
  | Welcome to ROOT 6.37.01                        https://root.cern |
  | (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jun 04 2025, 14:46:37                 |
  | From heads/master@8a8247f1                                       |
  | With g++ (Spack GCC) 14.2.0                                      |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

Installation method

Spack

Operating system

AlmaLinux 9

Additional context

$ root-config --features
cxx20 asimage asimage_tiff builtin_clang builtin_cling builtin_llvm dataframe fftw3 gdml geom gnuinstall http imt mathmore opengl pyroot roofit root7 rpath shared soversion spectrum sqlite ssl tmva tmva-cpu tmva-pymva tmva-sofie tpython unuran vdt webgui x11 xml xrootd

Metadata

Metadata

Assignees

Labels

bugexperimentAffects an experiment / reported by its software & computimng experts

Type

Projects

Status

Issues

Relationships

None yet

Development

No branches or pull requests

Issue actions