Can I Use pdfplumber on AWS Lambda Without Docker?

0
0
Asked By TechyTurtle99 On

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!

3 Answers

Answered By DevGuru_42 On

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.

Answered By LambdaGenius44 On

You might actually get it working with a Lambda layer! It can help package everything you need without dealing with the Docker complexity.

Answered By CodingWhiz_87 On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.