1

I am trying to import PIL on AWS.

I installed PIL using the below command.

pip3 install Pillow -t Desktop/myfolder

then zipped inside library and a lambda_function.py

It looks on aws console like this

EDIT : New snapshot

But I'm getting the below error.

ule 'lambda_function': cannot import name '_imaging'

Pro-Web
  • 31
  • 1
  • 11
  • First of all, why an image at all? Second, why an image that has a different error than the one you're asking about? – Ofer Sadan Jun 07 '18 at 09:49
  • @OferSadan that was by mistake . I updated question – Pro-Web Jun 07 '18 at 09:56
  • this question already has an answer here https://stackoverflow.com/questions/50734416/aws-lambda-unable-to-import-module-lambda-function-no-module-named-pil – Mausam Sharma Jun 07 '18 at 10:39

1 Answers1

-1

Python will not import names with a leading underscore unless the module defines an __all __ list that overrides this behavior. Leading underscores impact how names get imported from modules.

Refer here for detailed explanation.

Just do this instead

import PIL