1

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!

1
  • Wow, you made the solution to my problem so easy. Thanks for asking this question. If I could upvote again and again I would. Commented Feb 19, 2022 at 19:58

1 Answer 1

2

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/
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.