Reputation: 71
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. 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:
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?
Upvotes: 0
Views: 231
Reputation: 71
I figured it out...I hadn't hit "Deploy Changes" with the correct handler name. Doing so resolved the error.
Upvotes: 1