Error when trying to open an image

Terry Reedy tjreedy at
Mon Nov 17 00:31:24 CET 2014

On 11/16/2014 2:37 PM, Abdul Abdul wrote:
> Hello,
> I'm trying to open an image using the `Python Imaging Library` as follows:
> from PIL import Image
> img ='xyz.jpg')
> But, got the following error:
> File "C:/Users/abc/PycharmProjects/untitled/", line 2, in
> <module>
>      from PIL import Image
>    File "C:\Python34\lib\site-packages\PIL\", line 62, in <module>

Answer is on line above.  Good for you for posting traceback.

>      from PIL import _imaging as core
> ImportError: DLL load failed: %1 is not a valid Win32 application.
> Why is that? How can I solve this issue?

PIL does not work with 3.x.  Get pillow instead.

Terry Jan Reedy

More information about the Python-list mailing list