Hi, It is a (dumb) feature of cmake's FindPython that it choose the highest version of Python it can find on your computer, instead of using the first one on the path, which leads to these types of problems.
If you "grep -i python CMakeCache.txt", you'll see a number of variables associated with python, e.g. PYTHON_EXECUTABLE, PYTHON_INCLUDE_PATH, PYTHON_LIBRARY. You can set these at the command-line with -Dvariable_name=value. Doublecheck the values in CMakeCache.txt, because CMake likes to do things like use the python executable of one version, but the python library of another version (!). I'll add some text to the docs to handle this. - Noel On 30 August 2010 13:59, Rajarshi Guha <rajarshi.g...@gmail.com> wrote: > Thanks to Noel, I've got the Python bindings compiled, but it seems > that importing the openbabel package in Python is not working. > > On doing make install eevrything seems to go OK, but I get warnings as > shown in http://gist.github.com/557363 > > and when I try to import the package I get > > Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import openbabel > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/Library/Python/2.5/site-packages/openbabel.py", line 14, in <module> > import _openbabel > ImportError: dlopen(/Library/Python/2.5/site-packages/_openbabel.so, > 2): Library not loaded: /usr/local/lib/libopenbabel.3.dylib > Referenced from: /Library/Python/2.5/site-packages/_openbabel.so > Reason: image not found > > I now realize that Openbabel is using Python 2.6 which I have in > addition to 2.5. Is there a way I can force it to compile with 2.5? > > Thanks > > -- > Rajarshi Guha > NIH Chemical Genomics Center > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss