When I use ROOT 5, it works well. But when I turn to ROOT 6, there is an error, ( of course when I use ROOT 6, I can run the “./ExRootLHEFConverter target.lhe target.root” outside of python)
dyld: Library not loaded: @rpath/libCore.so
Referenced from: /Users/li/tools/packages/ExRootAnalysis2/ExRootLHEFConverter
Reason: image not found
The problem is that Apple is playing very safe here. With 10.11 any executable that comes from /usr/bin removes DYLD_LIBRARY_PATH from the environment. So, if your python comes from /usr/bin you will not see the environment variable DYLD_LIBRARY_PATH
python
>>> import os
>>> os.getenv('DYLD_LIBRARY_PATH')
If this works, then the next hurdle is os.system. This spawns a shell, which happens to reside in /usr/bin, therefore the variable is removed at the time you invoke ./ExRootLHEFConverter.
You can replace os.system by subprocess.call to overcome the problem.
[quote=“mato”]The problem is that Apple is playing very safe here. With 10.11 any executable that comes from /usr/bin removes DYLD_LIBRARY_PATH from the environment. So, if your python comes from /usr/bin you will not see the environment variable DYLD_LIBRARY_PATH
python
>>> import os
>>> os.getenv('DYLD_LIBRARY_PATH')
If this works, then the next hurdle is os.system. This spawns a shell, which happens to reside in /usr/bin, therefore the variable is removed at the time you invoke ./ExRootLHEFConverter.
You can replace os.system by subprocess.call to overcome the problem.