codingnewb
codingnewb

Reputation: 35

External Python Libraries Not Detected by AWS Lambda Functions

I am trying to use PyMuPDF in my lambda function on AWS.

I have used this youtube video to try to integrate the library as a layer so it will work on my lambda function. How to install Pandas on AWS Lambda function (in a nutshell: ZIP the linux library package and then save it a layer & then apply that layer to your function)

I have obtained the library from PyPI and have tried using the latest and older version and both of them does not work.

The ZIP file contains these two folders which are unpacked from the PyPI

Python_library.zip
│ python_library/PyMuPDF
└ python_library/PyMuPDF-1.18.10.dist-info

Does anyone know what am I doing wrongly? Some help would be greatly appreciated!

Upvotes: 1

Views: 796

Answers (1)

shimo
shimo

Reputation: 2285

Please check the folder in zip is python instead of python_library.

In aws-doc:

The following examples show how you can structure the folders in your layer .zip archive.

pillow.zip
│ python/PIL
└ python/Pillow-5.3.0.dist-info

This worked for me:

  • Python3.7
python.zip
└── python/
    ├── fitz/
    └── PyMuPDF-1.19.0.dist-info/

Upvotes: 2

Related Questions