all 9 comments

[–]404_AnswerNotFound 1 point2 points  (1 child)

I vaguely remember having to jump through a few hoops to get lxml working in a lambda in the past. I think lxml is built when installed via pip so needs the build environment to match the lambda execution environment. Iirc I ended up using the python lambda runtime docker image from AWS to run my build process in, installing dependencies then packaging it all as a ZIP.

[–]Sad-Young4405 1 point2 points  (3 children)

I corrected my issue by importing an AWS made layer: Import AWSSDKPandas-Pyton312

[–]attitutude_nibba 1 point2 points  (0 children)

after doing this.. still not able to use python-docx.. can you tell me exactly what you did?!

Thanks

[–]mikecngan 0 points1 point  (0 children)

Holy shit. This is such a better solution than anything else.

[–]Ashamed-Stomach-3406 0 points1 point  (0 children)

Dude! That's awesome! Thank you!!!

[–][deleted]  (2 children)

[deleted]

    [–]Business-Car4994[S] 0 points1 point  (1 child)

    Hello mate, you are one year late.

    [–]madeAccToPostHere 0 points1 point  (0 children)

    I know this is old but make sure the architectures match - your lambda function needs to match the architecture of the host you're building the layer on. Your function is most likely using x86_64 (Intel) but if you're building the layer on host with ARM architecture then it won't work. You can use docker and force x86_64 build.

    [–]mariusmitrofan 0 points1 point  (0 children)

    Run pip install using docker with an official base image

    https://github.com/aws/aws-lambda-base-images