1

EDIT: it was a conflict between Anaconda and Visual Studio. I was lucky to catch it.

Libwebp shows up in my environment in the Anaconda Navigator but I still get False for

print (features.check_module('webp'))

I don't know what else could be causing it. My code works perfectly for JPG and PNG images but when I try to convert WebP into one of these I get:

  File "C:\Users\Ze\anaconda3\lib\site-packages\PIL\Image.py", line 2967, in open
    raise UnidentifiedImageError(

UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x0000020F67040EF0>

I tried removing all packages and reinstalling everything but nothing :(

Here is my code:

def load_images_from_web(url):
    webp_format = requests.get(url)
    
    buffer = BytesIO(webp_format.content)
    
    
    image = Image.open(buffer).convert('RGB')
    
    image.save(buffer, 'jpeg')
    
    buffer.seek(0)
    
    file = {'file' : ('name', buffer.read(), 'image/jpg')}
    
    return file
 webp_format = requests.get(url)
    
    for x in range(20):
        print(BytesIO(webp_format.content).read(x))

First 20 bytes
b''
b'R'
b'RI'
b'RIF'
b'RIFF'
b'RIFF\xc6'
b'RIFF\xc67'
b'RIFF\xc67\x00'
b'RIFF\xc67\x00\x00'
b'RIFF\xc67\x00\x00W'
b'RIFF\xc67\x00\x00WE'
b'RIFF\xc67\x00\x00WEB'
b'RIFF\xc67\x00\x00WEBP'
b'RIFF\xc67\x00\x00WEBPV'
b'RIFF\xc67\x00\x00WEBPVP'
b'RIFF\xc67\x00\x00WEBPVP8'
b'RIFF\xc67\x00\x00WEBPVP8 '
b'RIFF\xc67\x00\x00WEBPVP8 \xba'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00'

Bytes 21-100
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89i'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa='
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3='
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1\x1f'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1\x1f\x8c'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1\x1f\x8c\xfe'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1\x1f\x8c\xfe\xab'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d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xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1\x1f\x8c\xfe\xab\xfeE\xf5\xdf\xe7\xff/?\xc3|\xe6\xe1.\xd4\xbf\x98\xfe%\xfe\x07'
b'RIFF\xc67\x00\x00WEBPVP8 \xba7\x00\x00p\xfd\x00\x9d\x01*\xf4\x01\x93\x01>m4\x96H\xa4"\xa2*#2\n\xe9@\r\x89in\xe1s\xb6\xd9*\xfb\xff\xd2\x9f{\xf1\xff\x9b\xfa=k\xd1\xff\xe3=&x\x93\xf9o\xf1\x1f\x8c\xfe\xab\xfeE\xf5\xdf\xe7\xff/?\xc3|\xe6\xe1.\xd4\xbf\x98\xfe%\xfe\x07\xf8'
14
  • Your error message indicates you were trying to open a BytesIO. Can you share that code and also dump the first 20 bytes of the BytesIO in hex? Commented Aug 22, 2021 at 8:31
  • Thank you so much for replying! It's supposed to be a WebP images. Shouldn't I use BytesIO in the conversion process? Here is my code codeshare.io/BAMBgK Commented Aug 22, 2021 at 8:45
  • Please ensure that you put your code in your question - not on some external site. You can do that by clicking edit under your image and pasting it in there. Then select it with the mouse and click {} in the Formatting Toolbar beside Bold and Italic. Also, please show the first 20 bytes of your BytesIO in hex. Commented Aug 22, 2021 at 8:48
  • Sorry about that! I edited my question with my code. I am not sure whether what I extracted is the 20 first bytes of the BytesIO in hex but I included them as well and the manner through which I got them. Commented Aug 22, 2021 at 9:16
  • 1
    You, my good sir, are a genius. Here's a cake. THANK YOU SO F******* MUCH!!!!!! It was actually a conflict between Visual Studio and Anaconda. I uninstalled everything then install Conda and it works like a charm. I love you forever and you are a gentleman and a scholar. Good day and tatata! Commented Aug 23, 2021 at 9:23

1 Answer 1

1

It was a conflict between Visual Studio and Anaconda. Uninstalled everything then reinstalled Anaconda. Hooray! Thanks Mark Setchell for leading me to the answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.