[英]I need help resolving a Runtime.ImportModuleError in AWS Lambda
I am new to AWS Lambda, and I am trying to run a simple print('hello') statement in a test scenario of a Lambda function written in Python. I am new to AWS Lambda, and I am trying to run a simple print('hello') statement in a test scenario of a Lambda function written in Python. However, I keep getting a Runtime.ImportModuleError.
但是,我不断收到 Runtime.ImportModuleError。 Here is my code:
这是我的代码:
import boto3
def handler(event, context):
s3 = boto3.client('s3')
csvfile = s3.get_object(Bucket='mybucket', Key='fname.csv')
print('hello')
Here is the name of my function:这是我的 function 的名称:
And here are my Runtime settings:这是我的运行时设置:
My test event is configured as:我的测试事件配置为:
{
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
When I hit the 'Test' button, however, I get this error message:但是,当我点击“测试”按钮时,我收到以下错误消息:
Response
{
"errorMessage": "Unable to import module 'dts_scrape': No module named 'dts_scrape'",
"errorType": "Runtime.ImportModuleError"
}
Does anyone know what is going on here?有谁知道这里发生了什么?
I figured it out...I hadn't hit "Deploy Changes" with the correct handler name.我想通了...我没有使用正确的处理程序名称点击“部署更改”。 Doing so resolved the error.
这样做解决了错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.