Can I Use pdfplumber on AWS Lambda Without Docker?
Asked by
TechyTurtle99
I've been struggling to get pdfplumber working on AWS Lambda. At first, I tried uploading all my dependencies in a zip file, but I ran into compatibility issues with Windows dependencies. So, I switched to using WSL and attempted to upload the dependencies both as a standard zip and through a Lambda layer. Unfortunately, both methods resulted in errors indicating that certain versions of `GLIBC` required by the `cryptography` package are missing. I was told that GLIBC 2.28 is necessary and that I should switch to using Docker. Is anyone here able to run pdfplumber without Docker? Just to clarify, I did manage to fix the issue after some debugging and found that using Python 3.13 is compatible as of November 2024, which cleared up a lot of confusion. After updating my runtime environment and adjusting some IAM policies, everything works now!
Answers
Consider building a Docker image instead. This way, you can customize your libc version while still deploying on Lambda. The problem is likely that your current Lambda runtime doesn't support the libc version you need, so switching runtimes or adjusting your dependencies could really help.
Reply to this answer
You might actually get it working with a Lambda layer! It can help package everything you need without dealing with the Docker complexity.
Reply to this answer
Make sure you're using Python 3.12 or later because earlier runtimes might not support the packages from pip. Hereโs a little tip: when installing, set the architecture for your Lambda function. Use `pip install` with the `--platform` and `--only-binary` options to ensure you get the right binaries, especially for something like cryptography.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions