• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Python Xcode project cannot find objc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python Xcode project cannot find objc


  • Subject: Python Xcode project cannot find objc
  • From: Mark Dancer <email@hidden>
  • Date: Fri, 9 Jan 2009 21:33:57 +1000

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,

Mark Dancer
email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Python Xcode project cannot find objc
      • From: email@hidden
  • Prev by Date: Re: Displaying project/path info in editor window title bars
  • Next by Date: Re: Python Xcode project cannot find objc
  • Previous by thread: Re: Displaying project/path info in editor window title bars
  • Next by thread: Re: Python Xcode project cannot find objc
  • Index(es):
    • Date
    • Thread