使用pydub和AWS Lambda [英] Using pydub and AWS Lambda
问题描述
下午全部-
因此,我认为标题确实说明了大部分内容,但现在就可以了.我是AWS和Lambda领域的新手,学习起来很有趣.我想要自动合并S3中的两个文件存储区,所以正在研究一个项目.我从AWS的查找人员那里找到了这个lambda函数(
So I think the title does say most of it but here goes. I'm new to the land of AWS and Lambda and having all sorts of fun learning this. I'm working on a project were I want to automagically merge two files stores in S3. I found this lambda function from the find folks at AWS (https://github.com/aws-samples/chime-voiceconnector-agent-assist/blob/master/infrastructure/function/src/retrieveMergedAudioUrl/lambda_function.py) and it references:
从pydub导入AudioSegment
from pydub import AudioSegment
所以我还无法弄清楚的是,如何在lambda/无服务器代码的世界中导入/构建pydub.
So what I haven't been able to quite figure out is, how do you import/build pydub in the world of lambda/serverless code.
谢谢
理查德
推荐答案
我建议按照以下说明将pydub作为Lambda层上传(但请在requirements.txt中添加pydub).如果您在本地运行pydub,则可以查找正在使用的版本:
I would recommend uploading pydub as a Lambda layer following these instructions (but subbing pydub in the requirements.txt). If you are running pydub locally, you can look up which version you're using with:
import pydub
print(pydub.__version__)
完整说明位于此处: https://medium.com/@qtangs/creating-new-aws-lambda-layer-for-python-pandas-library-348b126e9f3e
这篇关于使用pydub和AWS Lambda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!