Hi,
This is my first attempt to use Xcode (I have been using Python for some time, but I’m just starting with Xcode).
I created the simplest Python project I can (a Python-Cocoa Application), compile the project and run it. I’ve made exactly one change to the files Xcode generates: I added the line # coding=utf-8 to main.py, otherwise Python complains about the Xcode generated comments.
Running the project dumps me into GDB with a __TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__ from main.m, which is raised by the lines:
if ( result != 0 ) [NSException raise: NSInternalInconsistencyException format: @"%s:%d main() PyRun_SimpleFile failed with file '%@'. See console for errors.", __FILE__, __LINE__, mainFilePath];
Tracking back through the console, I find the Python interpreter has barfed:
Traceback (most recent call last): File "/Users/aelfric/Testing/build/Release/Testing.app/Contents/Resources/main.py", line 11, in <module> import objc ImportError: No module named objc 2009-01-09 21:05:25.860 Testing[1528:10b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '/Users/aelfric/Testing/main.m:44 main() PyRun_SimpleFile failed with file '/Users/aelfric/Testing/build/Release/Testing.app/Contents/Resources/main.py'. See console for errors.' 2009-01-09 21:05:25.865 Testing[1528:10b] Stack: ( 2501242304, 2506384620, 2501242064, 2501242120 )
Source code producing this error is from main.py:
# coding=utf-8 # # main.py # Testing # # Created by Ælfric on 09/01/2009. # Copyright __MyCompanyName__ 2009. All rights reserved. #
#import modules required by application import objc
My understanding is that objc is park of PyObjC, which I understand is now installed as part of Xcode (and has been since Xcode 3.0?).
My Xcode install was vanilla (default install to the default locations), so I’m scratching my head as to where I’ve gone wrong. Any suggestions?
• Mac OS X 10.5.6 • Xcode 3.1.2
Cheers,
|