Python Lambda - Missing files

Hi. I’m using your serverless framework to help me package up dependencies for a python script I have which uses DLIB for some machine learning (facial property detection).

I can run it fine locally, but when I use your system to package up my project ready for Lambda I am met with missing file errors coming from lambda its self:

Unable to import module 'handler': libcblas.so.3: cannot open shared object file: No such file or directory

On this note, I have a feeling there are lots of missing files. Any ideas how I can get serverless to find all these dependencies? There’s a lot of them…

Any ideas what’s is going wrong?

I still need help with this. Any ideas?

If you’re using serverless-python-requirements to package dependencies, it unfortunately does not bundle in the dynamic libraries required.

You have to build them in an environment that lambda functions use such as amazonlinux and bundle it.

But you can provide a custom Dockerfile to serverless-python-requirements and make it work

Here’s an example of tesseract library Dockerfile
https://github.com/bweigel/aws-lambda-tesseract-layer/blob/master/Dockerfile