0

I've a working python-script in which Image from Pillow is imported succesfully.

Like this: 'from PIL import Image'

After using py2exe and including PIL like any other Library, follwing error occurs:

'No module named Image'

All other Libraries seem to be work.

I already found this solution: http://www.py2exe.org/index.cgi/py2exeAndPIL

But it does not seem to fix my problem.Is there another possibility to tell py2exe to include 'Image' and all other needed parts from Pillow?

Thank you in advance, Nico

Nico Schmidt
  • 3
  • 1
  • 5
  • um... Pillow is the ‘friendly’ PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. – Anzel Nov 04 '14 at 17:29
  • Hey, yes that's true. But when you unzip the Pillow-egg, you can see that the library is still available by using 'PIL'. The script is working, py2exe is the only troublemaker. – Nico Schmidt Nov 04 '14 at 17:34
  • I haven't got much experience on Windows machines, I was just trying to suggest if this is the case of `from Pillow import Image` rather than `PIL` – Anzel Nov 04 '14 at 18:56
  • I would be very happy if anyone who already had to deal with a problem like this (py2exe did not include a library properly) would tell me how he finally fixed it. But thank you that you wanted to help, Anzel. – Nico Schmidt Nov 05 '14 at 16:11

1 Answers1

0

You can add PIL to your py2exe setup options, either in packages or includes:

setup (
  options = {"py2exe": {...
                        "packages": ["PIL"], # For everything
                        "includes": ["PIL.Image", # Or here for bits and pieces 
                                     "PIL.PngImagePlugin"]}},
  name="foo",
  ...
  )