key4hep / k4FWCore

Core Components for the Gaudi-based Key4hep Framework
Apache License 2.0
10 stars 26 forks source link

Error in k4run: ImportError: cannot import name 'EventCounter' from 'Gaudi.Configurables' (unknown location) #255

Open dasphy opened 1 day ago

dasphy commented 1 day ago

Hi experts, I'm using k4run for calo reconstruction, the command is:

$ k4run test/reconstruction/digi_reco.py --IOSvc.Output test/reconstruction/root/reconstruction_energy_10000_theta_90_particle_gamma_jobid_1.root --IOSvc.Input test/simulation/simulation_energy_10000_theta_90_particle_gamma.root

However there's an import error:

Traceback (most recent call last):
  File "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/2024-10-30/x86_64-almalinux9-gcc14.2.0-opt/k4fwcore/250eed082d3bbe153b61776666a5f05fc7314c0c_develop-3dtzdt/bin/k4run", line 258, in <module>
    main()
  File "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/2024-10-30/x86_64-almalinux9-gcc14.2.0-opt/k4fwcore/250eed082d3bbe153b61776666a5f05fc7314c0c_develop-3dtzdt/bin/k4run", line 184, in main
    load_file(file)
  File "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/2024-10-30/x86_64-almalinux9-gcc14.2.0-opt/k4fwcore/250eed082d3bbe153b61776666a5f05fc7314c0c_develop-3dtzdt/python/k4FWCore/utils.py", line 85, in load_file
    exec(code, globals())
  File "<string>", line 108, in <module>
ImportError: cannot import name 'EventCounter' from 'Gaudi.Configurables' (unknown location)

Do you have any idea about fixing that?

Cheers, Tong

andresailer commented 1 day ago

EventCounter no longer exists from Gaudi. A new one was only now merged to k4FWCore. Delete the EventCounter from the steering file you are using.

cf. #219 #252

jmcarcell commented 1 day ago

Or starting tomorrow it will be possible to import it from Configurables instead of Gaudi.Configurables.