-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pillow Import Issue when using custom FPDF2 Layer in AWS Lambda #1037
Comments
Hi and welcome @dpar21 Have you checked our documentation on how to use There is a subsection named "Creating & uploading a lambda layer" that provides an example of creating a lambda layer including all required dependencies for Does that solve your problem? |
Hello @Lucas-C and thank you for the link on how to create an AWS Lambda layer for FPDF2. Apologies, I was unable to find this in the documentation myself so I really appreciate the clarification. I definitely think I was incorrectly creating the Lambda layer so I will be sure to follow the instructions in the documentation and get back to this thread if I still continue to have issues. |
Thank you @Lucas-C! I simply had to remove the PIL and Pillow dependency folders after installing fpdf2 and then use a distinct Pillow layer as stated in the documentation. |
Glad that you found a solution! |
Hello,
I am currently attempting to use a custom FPDF2 layer for a Python3.8 runtime AWS Lambda function (I have tried Python3.9 and 3.10 as well) but am running into a Pillow not found issue.
Here is the exact warning + error I am running into:
Warning:
/opt/python/lib/python3.8/site-packages/fpdf/fpdf.py:33: UserWarning: Pillow could not be imported - fpdf2 will not be able to add any image
Error:
File "/opt/python/lib/python3.8/site-packages/fpdf/image_parsing.py", line 116, in get_img_info\n raise EnvironmentError("Pillow not available - fpdf2 cannot insert images")\n"
Based on previous posts and significant online research it seems like Pillow should be found even when I create a custom FPDF2 layer for AWS Lambda. I install both as well when building the layer to ensure that they are available prior to adding the layer to AWS Lambda.
Would appreciate any help or insight!
The text was updated successfully, but these errors were encountered: