Skip to content

Cannot open webp image: UnidentifiedImageError #86

@rgoubet

Description

@rgoubet

On an Anaconda distribution, after installing the libwebp package and pillow, I cannot open a webp file (e.g. the test.webp file from the libwebp library).

In [1]: from PIL import Image

In [2]: img = Image.open('test.webp')
C:\Users\user\anaconda3\lib\site-packages\PIL\Image.py:2942: UserWarning: image file could not be identified because WEBP support not installed
  warnings.warn(message)
---------------------------------------------------------------------------
UnidentifiedImageError                    Traceback (most recent call last)
<ipython-input-2-79ee787a81b3> in <module>
----> 1 img = Image.open('test.webp')

~\anaconda3\lib\site-packages\PIL\Image.py in open(fp, mode, formats)
   2941     for message in accept_warnings:
   2942         warnings.warn(message)
-> 2943     raise UnidentifiedImageError(
   2944         "cannot identify image file %r" % (filename if filename else fp)
   2945     )

UnidentifiedImageError: cannot identify image file 'test.webp'

Looks like Pillow/libwebp aren't properly set up on the Anaconda packages. I also tried reinstalling pillow after libwebp, but that didn't help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions