Forums

Cannot open Webp Image

When trying to open a webp image with PIL as follows:

my_res = requests.get(media_url) # returns webp image
im = Image.open(BytesIO(my_res.content)).convert('RGB')

i get the following error:

/home/pigu/twitter-tools/env/lib/python3.8/site-packages/PIL/Image.py:3185: UserWarning: image file could not be identified because WEBP support not installed

executing the following two lines returns False:

from PIL import features
print (features.check_module('webp'))

how can i fix this?

Upgrade your system image and try again. See https://help.pythonanywhere.com/pages/ChangingSystemImage

features.check_module('webp') returns True on haggis system image.

great, that did the job, thank you

Glad it worked!