views:

1427

answers:

2

If you did, would you mind sharing how you did the pyobjc install? I was trying to do it by installing PythonMac 2.5 (for the standalone bundle thru py2app), and doing easy_install of PyObjC. I always get those deprecated errors, primarily those declared in dyld.h, and inside objc_inject.m.

I tried compiling from source but still no luck.

Also, when I run my Leopard-compiled PyObjC app under Snow Leopard, it has errors concerning PyObjC, first time was it can't see Foundation or AppKit, second was typestr is unknown.

Thanks and appreciate your answers.

A: 

I already found a way... though I dunno if this is official or what...

I downloaded 2.5 version of PythonMac, installed it, and then added a symlink inside the installation directory, e.g.:

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python /Library/Frameworks/Python.framework/Versions/2.5/lib/site-python

This part made it seem as if the bundled PyObjC binaries are part of the PythonMac installation, and when I do easy_install, the system site-packages won't get affected. Also, worth noting is that you shouldn't conflict the system-bundled py2app by easy_install-ing py2app or else you'll encounter a typestr error.

I wanna know if there's anything wrong with this for me to be able to make a standalone PyObjC application under Snow Leopard.

jopes
+4  A: 

If you install the XCode Developer tools (optional Snow Leopard install), there's no need to manually install PyObjC at all. Here's how you can test it:

$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Foundation
>>> Foundation.NSString.stringWithString_(u'hello PyObjC')
u'hello PyObjC'
>>>

If the Foundation, AppKit, ScriptingBridge, modules can be imported, then everything is alright.

I would suggest using this method, it will make developing and testing much easier since you are using a standard system and standard python from Apple.
Redbeard 0x0A