[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'moviepy'

0

i have a lambda function that compresses video and descale them But when i try to import the moviepy mudule i am getting an error. I wrote a lambda function that install the moviepy and zip it then tried adding the zip file to the layer that is being used by my function but i am still getting the error: [ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'moviepy'

  • Just another thought. Compressing and descaling video is extremely CPU intensive. You may find that considering a service such as Elemental Media Convert gives you better performance and cost/second of video - than doing compression in Lambda.

CYN
질문됨 2달 전157회 조회
1개 답변
2

This is a good post of how to build a lambda layer.. The main thing is that your libraries in the ZIP file need to be in the correct folder structure otherwise it will not import them

https://medium.com/brlink/how-to-create-a-python-layer-in-aws-lambda-287235215b79

The correct folder structure for libraries/modules are here:- https://docs.aws.amazon.com/lambda/latest/dg/packaging-layers.html#packaging-layers-paths

Example file structure for the Python Pillow library

pillow.zip
│ python/PIL
└ python/Pillow-5.3.0.dist-info
profile picture
전문가
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠