Uncategorized

Error while importing python-whois on AWS Lambda


I’m trying to run a script that uses python-whois and I’m having an error. This was previously imported locally using “pip3 install python-whois -t .” and then uploaded to the zip file into AWS Lambda. I’m using Python v3.12

import json
import whois


def lambda_handler(event, context):    
    
    return {
        'statusCode': 200,
        'body': event
    }

The error message:

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'imp'
Traceback (most recent call last):



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *