简体   繁体   English

我需要帮助解决 AWS Lambda 中的 Runtime.ImportModuleError

[英]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.

相关问题 AWS Lambda Python 错误 - Runtime.ImportModuleError - AWS Lambda Python error - Runtime.ImportModuleError 如何解决“Runtime.ImportModuleError”在 AWS lambda 中没有名为“mysql”的模块? - How to solve “Runtime.ImportModuleError” No module named 'mysql' in AWS lambda? AWS Lambda Docker 自定义 Python 库 (Runtime.ImportModuleError) - AWS Lambda Docker Custom Python Library (Runtime.ImportModuleError) 将代码上传到 AWS lambda 错误 Runtime.ImportModuleError - Upload code to AWS lambda error Runtime.ImportModuleError Runtime.ImportModuleError:无法导入模块(lambda) - Runtime.ImportModuleError: Unable to import module (lambda) AWS "Hello World" Python Lambda 导致 Runtime.ImportModuleError: "Unable to import module" - AWS "Hello World" Python Lambda results in Runtime.ImportModuleError: "Unable to import module" Runtime.ImportModuleError: Unable to import module 'testsdk': No module named 'jsonpickle' with Python script using AWS Lambda - Runtime.ImportModuleError: Unable to import module 'testsdk': No module named 'jsonpickle' with Python script using AWS Lambda AWS Lambda代码无法从S3导入Depdendencies - Runtime.ImportModuleError - AWS Lambda Code Unable to Import Depdendencies from S3 — Runtime.ImportModuleError AWS Lambda python 错误:Runtime.ImportModuleError:无法导入模块“app”:无法从“pyparsing”导入名称“operatorPrecedence” - AWS Lambda python Error: Runtime.ImportModuleError: Unable to import module 'app': cannot import name 'operatorPrecedence' from 'pyparsing' Runtime.ImportModuleError:无法导入模块“lambda_function”:没有名为“httplib2”的模块 - Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'httplib2'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM