Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm trying to create an AWS lambda function in order to create a thumbnail of my uploaded images. My script is running well locally, I followed this tutorial to deploy my function but I have a problem with the Pillow library, indeed when I'm testing my function I can see this following log :

image

1 Answer

0 votes
by (44.4k points)

Include libjpeg.so in your lambda package, but also some changes are required in the file. Assuming If you do this “pip install module-name -t”, do this:

cd into/your/local/lambda/package/dir

cp -L $(ldd PIL/_imaging.so|grep libjpeg|awk '{print $3}') PIL/

patchelf --set-rpath PIL PIL/_imaging.so

# zip, deploy and test the package

This script works for Pillow version 3.2.0.

Related questions

0 votes
1 answer
Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...