[Pyobjc-dev] Reprise: Import error: Bundle could not be loaded
Brought to you by:
ronaldoussoren
From: Mike R. <ros...@fr...> - 2006-03-10 16:51:41
|
For the benefit of future archive searchers, I will summarize the solution I stumbled on to regarding the "Import error: Bundle could not be loaded" problem I was experiencing with loading up my own framework in PyObjC. Scenario: Attempting to build a simple python test harness to perform unit tests on a custom framework. Problem: The following code generates the error "Import error: Bundle could not be loaded". import sys import objc fubarBundle = objc.loadBundle("Fubar", globals(), bundle_path=u'the_path_to/Fubar.framework') Cause: The Fubar.framework references another custom framework which could not be located. Solution: Fubar.framework wants alice.framework. So I dropped a copy of alice.framework into /Library/Frameworks/ and the above code worked properly and I was able to exercise the Fubar framework. (~/ Library/Frameworks/ worked as well.) Analysis: Performing a loadBundle in the test harness python code on alice.framework successfully loaded alice but did not make it visible to Fubar. Neither did an NSBundle.bundleWithPath followed with a load. The disadvantage of the above solution is that it requires potentially unstable frameworks to be loaded into a system-visible location. (There's probably some other way to make alice visible within this process and I would surely like to hear about it.) Mike |