Snow leopard: root but no pyroot

Hi,

I am new to mac, using Snow Leopard, and I downloaded the tarball which works out of the box for ROOT. Also TPython::Exec works fine. But for pyroot, after adding ROOTSYS/lib to PYTHONPATH, I get:

[code][GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “/Users/blenzi/bin/root_v5.25.02/lib/ROOT.py”, line 86, in
import libPyROOT as _root
ImportError: dlopen(/Users/blenzi/bin/root_v5.25.02/lib/libPyROOT.so, 2): no suitable image found. Did find:
/Users/blenzi/bin/root_v5.25.02/lib/libPyROOT.so: mach-o, but wrong architecture[/code]

Investigating a bit:

pb-d-128-141-141-126:Downloads blenzi$ file `which root` /Users/blenzi/bin/root_v5.25.02/bin/root: Mach-O executable i386 pb-d-128-141-141-126:Downloads blenzi$ file `which python` /usr/bin/python: Mach-O universal binary with 3 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 /usr/bin/python (for architecture ppc7400): Mach-O executable ppc pb-d-128-141-141-126:Downloads blenzi$ file /Users/blenzi/bin/root_v5.25.02/lib/libPyROOT.so /Users/blenzi/bin/root_v5.25.02/lib/libPyROOT.so: Mach-O dynamically linked shared library i386

Do I have to compile from the source?

Thanks,
Bruno

Bruno,

well, this is the one that you’d want to start, I think:

/usr/bin/python (for architecture i386): Mach-O executable i386

I’m not sure whether as a user one can make an explicit selection from the fat binary, though (I’m not a Mac expert, and a google search didn’t yield anything useful).

Building from source would work, of course, as everything would be 64b at that point.

Cheers,
Wim

Thanks Wim. I found 2 possibilities but for the moment none work:

$arch -i386 python -> same error

$lipo -extract i386 -output ~/bin/python32 which python2.6
$ file ~/bin/python32
/Users/blenzi/bin/python32: Mach-O executable i386
$python32

import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “/Users/blenzi/bin/root_v5.25.02/lib/ROOT.py”, line 86, in
import libPyROOT as _root
ImportError: dlopen(/Users/blenzi/bin/root_v5.25.02/lib/libPyROOT.so, 2): Library not loaded: @rpath/libCore.so
Referenced from: /Users/blenzi/bin/root_v5.25.02/lib/libPyROOT.so

Any hope for the 2nd one?

Cheers,
Bruno

have you tried to run $ROOTSYS/bin/python64 ?

Hi,

$ROOTSYS/bin/python64 does not exist for me. Anyway I compiled from source and it worked fine. But since this will probably happen to every snow leopard user, would it be possible to have a 64-bit version?

Thanks,
Bruno

Bruno,

the only thing that I could think of, is a problem in LD_LIBRARY_PATH, but that’s unlikely, no?

python64 should not be there in your case, as it is meant for 10.5 (which uses a 32b python only by default, rather than a fat 64b/32b one).

Hopefully I can get my hands on a snow leopard soon …

Cheers,
Wim

[quote=“wlav”]Bruno,
python64 should not be there in your case, as it is meant for 10.5 (which uses a 32b python only by default, rather than a fat 64b/32b one).

Hopefully I can get my hands on a snow leopard soon …

Cheers,
Wim[/quote]

ok, my bad.
I compiied root on 10.5 and made then the upgrade to 10.6.
Im still using the same root-installation with it’s python64, because even after the upgrade (maybe different with clean installation)
I have only a 32bit version of python installed.