I am having a difficult time installing PyRoot on my PPC OS X (version 10.4.10) machine. Reading some posts in this forum has helped, but I’m still getting errors.
I downloaded the current version of ROOT 5.16 to /usr/local/root through cvs and configured it as follows:
I cannot find a libpython2.4.so file (there was a libpython2.4.a and libpython2.4.dylib file).
I do have a couple of versions of python installed. The native version, one through fink, and one called MacPython. All are version 2.4. The one that runs I execute ‘python’ is the native system version located in /Library/Frameworks/Python.framework/Versions/2.4/bin/python
The --enable-framework flag does not work. I get an ‘Invalid option’ error.
After the ./configure I ‘sudo make install’
If I launch python and try ‘import ROOT’ I get the following error.
Traceback (most recent call last):
File “”, line 1, in ?
File “/usr/local/root/lib/ROOT.py”, line 83, in ?
import libPyROOT as _root
ImportError: Inappropriate file type for dynamic loading
In .bash_profile I have set the following variables
export ROOTSYS=/usr/local/root
export PATH=$ROOTSYS/bin:$PYTHONDIR/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/root/lib:/usr/local/lib
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
export MANPATH=$MANPATH:$ROOTSYS/man
python2.4 is older than Mac OS-X 10.4. In 10.4, the definition of a loadable shared library changed, and Apple changed the python Makefile explicitly to reflect this for their system python. That change isn’t in p2.4. Follow the instructions and discussion here: http://root.cern.ch/phpBB2/viewtopic.php?t=3226&start=23
Yes, you need to rebuild python. Moving to p2.5 would be even better and solve many Mac-related p2.4 problems.
The new version of python v2.51 was successfully installed. ROOT was rebuilt upon the new version. Now when I ‘import ROOT’ I receive the following fatal message, the same message Emanuele received in your linked post:
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap
Any ideas? It didn’t seem like the issue was resolved the first time.
is a common problem on Mac … it means that you are running with a different python than the one that has been built against. Like I posted in the other thread … output from otool?
Myself, I’ve never been able to resolve the above on a custom python other than through an ordinary framework build in the normal place. Stefan, however, managed to get it working, though: http://savannah.cern.ch/bugs/?22003
I used a standard framework install from a universal installer for PPC and Intel macs located at the python.org web site. I checked, and it put everything in the standard location, i.e. /Library/Frameworks/Python.framework/…
I tried to run otool -L libPyROOT.so, but it appears like I don’t have the necessary file on my machine.
well, unless I missed them, I don’t know what your latest options are, just that these:[quote]–with-python-incdir=/opt/local/Library/Frameworks/Python.framework/Headers --with-python-libdir=/opt/local/Library/Frameworks/Python.framework[/quote]
should be removed, or point to p2.5 (IIRC, it’s picked up by itself, if you don’t specify any options).
Further, the ‘python’ command should of course be p2.5, and the set of DYLD_LIBRARY_PATH, LD_LIBRARY_PATH, and PYTHONPATH may not point to any of the other (older) python shared libs.
I did check to make sure python launches the correct version and it does. I removed the flags and recompiled. The ./configure works, but now the ‘make’ doesn’t work. The error message:
*** No rule to make target /Library/Frameworks/Python.framework/Versions/Current/include/python2.4/Python.h', needed bypyroot/src/Adapters.o’. Stop.
Of course that directory doesn’t exist anymore because python2.5 folder has supplanted it.
If I explicitly include the python-incdir and python-libdir directories I don’t get the ‘no rule to make target’ message; I get the old ’ Interpreter not initialized (version mismatch?)’ problem.
my current profile:
export PYTHONDIR=/Library/Frameworks/Python.framework/Versions/Current/
export ROOTSYS=/usr/local/root
export PATH=$ROOTSYS/bin:$PYTHONDIR/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/root/lib:/usr/local/lib
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
export MANPATH=$MANPATH:$ROOTSYS/man
strange that the normal way doesn’t work. Does “Current” under “Versions” point to 2.5? The configure script tries this base path “/Library/Frameworks/Python.framework/Versions/Current” and tries the “/System/…” after that.
As for the options, this one:
[quote]–with-python-libdir=/Library/Frameworks/Python.framework/Versions/2.5/lib[/quote]should likely be this (drop the ‘lib’): --with-python-libdir=/Library/Frameworks/Python.framework/Versions/2.5/
That is, it should point to the location of “Python” (note cap), which is an archive containing the loadable shared library. (IIRC)
Things now work and I have no idea why. I started with a fresh ftp downloaded of the source from root.cern.ch, recompiled using the exact same flags, and viola–‘import root’ works.
For the benefit of others reading this post, all I had to do was.
checkout new source
install version 2.5 of python available as a universal binary from python.org
./configure --enable-python (+ some other things I wanted like minuit2, roofit, etc. )