[C++-sig] Boost.Python to use non-standard python location on OS X

Roberto Aguilar roberto.c.aguilar at gmail.com
Thu Jul 27 00:17:31 CEST 2006


I'm trying to build the example Boost.Python project on OS X using the
python version 2.4.2 provided by Fink, which is installed at:


The includes and libraries are:


I set the following in my Jamrules file:

PYTHON_INCLUDES = /sw/include/python2.4 ;
PYTHON_LIB_PATH = /sw/lib/python2.4 ;

But, when I build, it seems that the resulting module is still linking
to /usr/bin/python, which is version 2.3.

Trying to use the module using /sw/bin/python results in:

[berto at drjekyll][713]$ /sw/bin/python
Python 2.4.2 (#1, Mar 22 2006, 18:15:19)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import data
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap

But using /usr/bin/python, everything works well.

I then thought the problem was that I built boost without specifying
the non-standard location so I recompiled using:

bjam -sTOOLS=darwin -sPYTHON_ROOT=/sw -sPYTHON_VERSION=2.4
-sPYTHON_LIB_PATH=/sw/lib/python2.4 -a

Still no luck.

Any ideas are greatly appreciated.


More information about the Cplusplus-sig mailing list