I am trying to use the Pillow Image in my project, passing it as a local library to my AWS Lambda Function use.
The files are located like this:
Backend(folder with the lambda_handler code)
Libraries(folder with some folders to store some libraries)
PIL(folder with the files inside Libraries)
My lambda_handler code is importing Image like this:
from Libraries.PIL import Image
The only time that I use Image is to open one Image as an argument to one function.
When I upload and test the Lambda Function, I am receiving the following error:
{
"errorMessage": "Unable to import module 'Backend/lambda_function': cannot import name '_imaging' from 'Libraries.PIL' (/var/task/Libraries/PIL/__init__.py)",
"errorType": "Runtime.ImportModuleError"
}
I already uninstall all Pillow versions and tried using only one version, the most recent version (7.2.0), and some old versions (6.0.0 and 5.0.0).
I am using Python 3.7
Note: Running the program locally everything works ok, but when I run it in AWS Lambda the I receive the error.