[Pyobjc-dev] Mixing py2app with Python C interface plugins
Brought to you by:
ronaldoussoren
From: Ian B. <ia...@on...> - 2010-01-24 18:12:58
|
Hey folks, I'm working on a plugin that adds several Python scripts to a program. Previously I was just compiling it with py2app, but this slowed the main application launch way down so the developer asked me to switch to manually setting things up via Objective-C and the Python C interface. I did so, and it works great. However, now there's a second plugin that uses py2app, and it's conflicting with my plugin because the Python interpreter is already setup by the time my plugin gets to it and for some reason it's causing my main Python file to try and import from both the Python 2.5 framework and the 2.6 framework when I run it using PyRun_SimpleFile (I'm on 10.6, obviously). I get a bunch of error messages along these lines in the console before the whole thing crashes: Class OC_NSBundleHack is implemented in both /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/objc/_objc.so and /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC/objc/_objc.so. One of the two will be used. Which one is undefined. Any ideas how I can get my C API plugin and the third party py2app plugin to live happily in the same Python interpreter? I'm pretty sure this is a simple problem of the Python environment being setup differently by py2app and my C API code, but I'm not sure what types of things I might need to change to fix the problem. Thanks for any suggestions you can give me! Ian |