[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pythonmac-sig
Subject:    Re: [Pythonmac-SIG] py2app and Pyhon Imaging Library PIL
From:       "Bob Ippolito" <bob () redivi ! com>
Date:       2006-10-20 18:31:35
Message-ID: 6a36e7290610201131s72487d7ckc225600167999632 () mail ! gmail ! com
[Download RAW message or body]

On 10/20/06, Martin Dunschen <zabaione@uk2.net> wrote:
> I had the following problem with a python script that imports the Image
> module:
>
> ...
> import Image
> ...
>
>
> When I build an app with py2app I got an error that Image can't be found.
> I tracked the problem down to the file
> MyApp.app/Contents/Resources/__boot__.py
> which imports it.
>
> In there changed the line
> import Image
> to
> from PIL import Image
>
> and also how I import Image in my own script. It works.
>
> But I don't understand why the original version does not work?

The canonical way to import PIL is "import Image" not "from PIL import
Image". You should be using "import Image" in your script.

If you use "import Image" then it should work in py2app. It works here
anyway, if it still doesn't work you're going to need to provide
enough information to reproduce the problem.

> I understand that __boot__.py in created, but is there a template I can
> change? Is that the right way to fix this problem?

__boot__ is generated from the recipes and prescripts. This line comes
from the PIL recipe.

No, that's not the right way to fix it. I don't think it's broken, anyway.

-bob
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic