将boto2作为AWS Lambda函数运行python [英] Running python with boto2 as an AWS Lambda function
问题描述
我正在使用来自github的python脚本在AWS lambda上运行.我意识到在lambda中运行时,导入boto语句不起作用.有没有办法指示lambda加载boto2?
I am using a python script from github to run on AWS lambda. I realized that the import boto statements are not working while running inside lambda. Is there way to instruct lambda to load boto2 as well?
推荐答案
好的,我要做的就是根据文档使用"pip install module-name -t/path/to/project-dir"安装boto: http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
OK, all I had to do was install boto using "pip install module-name -t /path/to/project-dir" per the docs: http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
然后压缩lambda所需的文件并上传.
Then zipped the files needed for lambda and uploaded.
这篇关于将boto2作为AWS Lambda函数运行python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!