Home > Blockchain >  File extensions missing from Python Lambda Lambda Dependency. Will this cause my Function to fail?
File extensions missing from Python Lambda Lambda Dependency. Will this cause my Function to fail?

Time:11-23

I was given a .zip file that had an external library called Python PDF Toolkit, often abbreviated as pdftk or pypdftk.

To my current knowledge, this external dependency was built on a EC2 instance of CentOS6, because the pdftk has its own dependency called libgcj.

enter image description here

As you can see from the image, most of the files are Unix Executable Files, and are missing their file extensions.

  1. Will this create problems in Lambda? I believe the pdftk needs to be uploaded as a Lambda Layer to help extend the standard core Python Library.

  2. If this will create problems executing Lambda, are there any steps I can take to find the file extensions?

Lastly, I can edit this question and add the code within these files if you believe that will help.

WHEEL

Wheel-Version: 1.0
Generator: bdist_wheel (0.35.1)
Root-Is-Purelib: true
Tag: py2-none-any

It looks like this won't work with Py3?

CodePudding user response:

pypdftk is a wrapper for pdftk binary. So you need 2 things:

  1. Install the pdftk binary as a Lambda Layer. For more details look here.
  2. You also need the python code. It seems that this is only a python file. You can either copy it directly or your code or install it with pip. It should work with python 3.

You have been provided with a wheel package. Chances are that it won't work with lambda and python 3, although it isn't impossible to properly configure everything. It should be easier to install pypdftk and binary dependencies from scratch.

  • Related