[Pythonmac-SIG] py2app and Django

Ronald Oussoren ronaldoussoren at mac.com
Fri Aug 4 07:08:13 CEST 2006


On Aug 4, 2006, at 5:47 AM, Rob Hudson wrote:

> (My apologies if this starts a new thread -- I'm posting from a
> different mailing address and don't have the original email to  
> reply to)
>
>> Django can not be packaged normally because it has in-package data
>> files. It won't work with either py2exe or py2app without tweaking.
>
> Can you point me to or help me understand what in-package data  
> files are
> and why this affects it?

The exception you're getting:

    File "django/db/__init__.pyc", line 18, in ?
OSError: [Errno 20] Not a directory: '/Users/rhudson/Desktop/
Django-0.95/dist/run.app/Contents/Resources/lib/python2.3/site-
packages.zip/django/db/backends'

This indicates that some part of django tries to do a directory  
listing of the directory containing django.db.backends. This can mean  
two things: one is that there are data files in that directory  
(configuration data, images, ...), the other is that some setup code  
tries to locate all modules in that package.

With py2app and py2exe python code isn't stored directly in the  
filesystem but in zipfiles. Any code that tries to access the  
location where python code as if it were the filesystem will  
therefore fail.

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2157 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060804/03c5c523/attachment.bin 


More information about the Pythonmac-SIG mailing list