Unable to import module 'index': cannot import name '_imaging' from 'PIL' in AWS lambda

88 Views Asked by At

My lambda function uses library pillow for image conversion. It works fine locally. However, when I deploy it to AWS - I get

Runtime.ImportModuleError: Unable to import module 'index': cannot import name '_imaging' from 'PIL'

I am using lambda layer Klayers-p38-Pillow by ARN. I have verified and confirmed that python version matches the layer runtime version (3.8) and that the architecture is x86_64.

enter image description here

What am I doing wrong?

0

There are 0 best solutions below