[Pythonmac-SIG] AppKit ImportError (was py2app: ImportError)

Ronald Oussoren ronaldoussoren at mac.com
Mon Oct 24 13:12:25 CEST 2011


On 13 Oct, 2011, at 18:25, Sean Robinson wrote:

> On 10/10/2011 07:44 AM, Sean Robinson wrote:
>> On 10/08/2011 07:36 AM, Ronald Oussoren wrote:
>>> 
>>> On 6 Oct, 2011, at 22:35, Sean Robinson wrote:
>>>> 
>>>> I believe I can overcome this error by finding the right path(s) to
>>>> append to the app bundle's sys.path, but I'm surprised that py2app
>>>> does not do this automagically.
>>> 
>>> py2app should do this automaticly. What version of python do you use?
>>> Is that a custom install or the system version of python? And finally,
>>> which OSX version are you using?
>>> 
>> 
>> This is on OSX 10.6.8, using the system version of Python 2.6.1. The
>> only non-standard packages/modules are py2app (0.6.4 pre-release and its
>> requirements) installed local to the user account. I am developing as
>> vanilla as I can get.
>> 
> 
> Ronald,
> 
>  So, to follow-up...  I have been able to create a working semi-standalone app bundle (which is what I wanted) by adding two more dirs to sys.path.  Thank you for py2app and for your help.  My app bundles work on 10.6.3 and 10.6.8 with the default Apple-provided Python on each.
> 
>  Attached to this message is a zip archive with two minimal projects (working and not_working) which highlight the single difference which allows AppKit to be imported.  Each project is three lines of python plus the setup.py created by py2applet.  IHTH.

That was a pretty lame bug: when using the system build of Python we don't include Python and the "standard" library into the application bundle, including the extra libraries like PyObjC and wxWidgets. That part worked fine, but py2app never made sure that the directory with extra libraries was available on sys.path and that causes the problem you're having.

I've pushed a fix for that to the repository, and will push a new release to PyPI later today.

Ronald

> 
> -- 
> Sean Robinson
> Laboratory Technician
> Physics Astronomy Geology
> sean.robinson at sccmail.maricopa.edu
> <quot-test.zip>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4788 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20111024/bd9f9d83/attachment.bin>


More information about the Pythonmac-SIG mailing list