1

I have deployed my AWS lambda with layers, installed all dependent modules in layers.

Following is the uploaded layer zip contents: enter image description here

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 :)

Shubhi Sood
  • 400
  • 3
  • 11
  • similar https://stackoverflow.com/questions/25340698/importerror-cannot-import-name-imaging – sandes Sep 21 '20 at 18:02

0 Answers0