Opened 5 years ago
#1394 new How to
Cannot import Delphes in python macOS
Reported by: | Giacomo Boldrini | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Delphes code | Version: | Delphes 3 |
Keywords: | Libraries | Cc: |
Description
Hello Delphes experts.
I cannot manage to import libDelphes in python. I succed in loading Delphes in root from the console at the second try (because first try it gives me errors):
root [0] gSystem->Load("libDelphes")
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeReader.h
requested to autoload type ExRootTreeReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeWriter.h
requested to autoload type ExRootTreeWriter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTreeBranch.h
requested to autoload type ExRootTreeBranch
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootResult.h
requested to autoload type ExRootResult
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootClassifier.h
requested to autoload type ExRootClassifier
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootFilter.h
requested to autoload type ExRootFilter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootProgressBar.h
requested to autoload type ExRootProgressBar
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
requested to autoload type ExRootConfParam
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
requested to autoload type ExRootConfReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
Missing FileEntry for ExRootAnalysis/ExRootTask.h
requested to autoload type ExRootTask
(int) 0
root [1] gSystem->Load("libDelphes")
(int) 1
root [2]
However I cannot do the same at all in python. Suppose I create a script in the exact same directory where libDelphes.so is stored then if I run:
Giacomos-MBP:Delphes bcoder$ python
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import ROOT
ROOT.gSystem.Load("libDelphes")
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/bcoder/MG5_aMC_v2_6_6/Delphes/libDelphes.so, 9): Library not loaded: @rpath/libHist.so
Referenced from: /Users/bcoder/MG5_aMC_v2_6_6/Delphes/libDelphes.so
Reason: image not found
-1
I get that error. I checked and libHist is in my libPyRoot library so what am I doing wrong? I export everything in my bash_profile as I think I should but nothing. Is it something to do with the new library issue about apple (not caring of LD_LIBRARY_PATH or DYLD...) or am I missing something?
Is there a way to read Delphes outputs without loading libDelphes using python?
Thank you very much I look forward to your answer,
Cheers, Giacomo