tags:

views:

27

answers:

1

I have a C/C++ application in which I define a Python module. I set up Python like this:

PyImport_AppendInittab("myModule", initmymodule);
Py_Initialize();

PyObject *module = PyImport_ImportModule("myModule");

On the ImportModule call, I get this warning:

sys:1: RuntimeWarning: Python C API version mismatch for module myModule: This Python has API version 1012, module myModule has version 1013.

I'm building this app in Xcode, linking against the Python framework in /System/Library/Frameworks (which contains versions 2.3, 2.5 and 2.6). I always include the Python headers with #include <Python/Python.h>. How can my module have a different version if it's part of the same binary that does the initialization?

A: 

Are there any other Pythons installed in /Library/Frameworks/, like ones from a python.org installer?

Ned Deily
Yes, there's one there that's version 2.4. Apparently Xcode is getting confused about which one it's using. So the question is how to straighten that out.
Uncommon
I went ahead and deleted the 2.4 framework. It's not really needed as far as I can tell.
Uncommon
Only if you want to use Python 2.4. Any Python frameworks in `/Library/Frameworks` are fair game to delete but you should not, of course, delete things in `/System/Library/Frameworks`.
Ned Deily