PyRoot Working with Spyder

Hi,

I have both Python and ROOT working on my computer. If I do:

xxx$ python
Python 2.7.5 (default, Sep 12 2013, 21:33:34)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT

This works fine in the terminal.

However, if I open up Spyder:Google Code Archive - Long-term storage for Google Code Project Hosting.
And I set the python to the same python version, I still cannot import ROOT:

Python 2.7.5 (default, Sep 12 2013, 21:33:34)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “/Users/xxx/root/lib/ROOT.py”, line 103, in
import libPyROOT as _root
ImportError: dlopen(/Users/xxx/root/lib/libPyROOT.so, 2): Library not loaded: @rpath/libRIO.so
Referenced from: /Users/xxx/root/lib/libPyROOT.so
Reason: image not found

Could anyone help me with this? I already set the Spyder PYTHONPATH manager to include: root/lib. But I think I am missing some settings?

Hi,

apparently LD_LIBRARY_PATH is not honored from within Spyder (it should have an entry for $ROOTSYS/lib; check os.environ[‘LD_LIBRARY_PATH’]). If the IDE offers no way of setting it, you can also set it from python before loading ROOT.

Cheers,
Wim