Re: [Pyobjc-dev] Problem running PyObjC/py2app app on machine without PyObjC installed
Brought to you by:
ronaldoussoren
From: Zachery B. <zb...@ur...> - 2013-05-10 14:16:31
|
On May 10, 2013, at 5:11 AM, Ronald Oussoren <ron...@ma...> wrote: > On 9 May, 2013, at 20:14, Zachery Bir <zb...@ur...> wrote: > >> Hey, all. Long time no see. > > Welcome back :-) > >> >> So, I've revived one of my PyObjC apps (Zem), but am running into problems getting the resulting app to launch on systems that don't already have PyObjC installed. This hasn't so far happened with my other PyObjC apps, so I'm wondering if I'm just doing something wrong. >> >> Here's a link to the py2app-built binary: http://swng.it/nP7QK >> >> Here's the code: https://github.com/orangutango/Zem/ >> >> I could tell that some things had changed in the PyObjC/py2app worlds since the last time I heavily used them. >> >> I built this bundle the standard way: >> >> $ python setup.py py2app --iconfile Resources/Zem.icns >> >> (Incidentally, I'm not sure why it doesn't pick up on my Info.plist entry for CFBundleIconFile, but whatever) > > That is a bug, py2app should pick up CFBundleIconFile (although you should arrange for it to be copied into the app bundle, which your setup.py file does). I figured as much. This is less an immediate problem, of course. >> The error I get on machines without PyObjC installed is: >> >> Zacherys-Mac:~ zbir$ Downloads/Zem.app/Contents/MacOS/Zem >> Traceback (most recent call last): >> File "/Users/zbir/Downloads/Zem.app/Contents/Resources/__boot__.py", line 316, in <module> >> _run() >> File "/Users/zbir/Downloads/Zem.app/Contents/Resources/__boot__.py", line 311, in _run >> exec(compile(source, path, 'exec'), globals(), globals()) >> File "/Users/zbir/Downloads/Zem.app/Contents/Resources/ZemAppDelegate.py", line 12, in <module> >> from PyObjCTools import AppHelper >> File "PyObjCTools/AppHelper.pyc", line 14, in <module> >> File "AppKit/__init__.pyc", line 43, in <module> >> File "AppKit/_AppKit.pyc", line 14, in <module> >> File "AppKit/_AppKit.pyc", line 10, in __load >> ImportError: dlopen(/Users/zbir/Downloads/Zem.app/Contents/Resources/lib/python2.7/lib-dynload/AppKit/_AppKit.so, 2): Symbol not found: _OBJC_CLASS_$_NSObject >> Referenced from: /Users/zbir/Downloads/Zem.app/Contents/Resources/lib/python2.7/lib-dynload/AppKit/_AppKit.so >> Expected in: /usr/lib/libobjc.A.dylib >> in /Users/zbir/Downloads/Zem.app/Contents/Resources/lib/python2.7/lib-dynload/AppKit/_AppKit.so >> 2013-05-09 13:54:37.926 Zem[347:707] Zem Error > > It shouldn't make a difference whether or not you installed PyObjC, the app should always load the version of PyObjC that is in the bundle. > > What are the OSX versions of the machine where you build PyObjC and where you tried to start the application? This might be a deployment target issue, that is a binary with a deployment target that is higher than the OS you try to run the app on. I'm building Zem on 10.8.2, but I get the error on other 10.8.2 machines without PyObjC installed. The specific error I pasted earlier came from 10.7.5. What's the best way to declare deployment target in a totally script-driven py2app environment? Thanks, Zac |