I have deployed my AWS lambda with layers, installed all dependent modules in layers.
Following is the uploaded layer zip contents:
Still getting following exception while running lambda:
Unable to import module 'handler': cannot import name '_imaging' from 'PIL' (/opt/python/lib/python3.7/site-packages/PIL/init.py)
Lambda Snippet:
import json
from PIL import Image
def ocr(event, context):
# TODO implement
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
I am using ubuntu machine to generate Lambda layer and deploying it over AWS using aws deploy command.
Tried updating Local Machine Python version to 3.7.9. still not working.
Any suggestions would help me alot.. Thanks :)