When I run command "sam local invoke LambdaFunction --event events/get_users.json", it gives the following error:

`Invoking main.lambda_handler (python3.8)
arn:aws:lambda:sa-east-1:061977363137:layer:pyodbc-layer-3_8:1 is already cached. Skipping download
arn:aws:lambda:sa-east-1:061977363137:layer:my-api-libs:3 is already cached. Skipping download
Local image is up-to-date
Using local image: samcli/lambda-python:3.8-x86_64-25626f11905fabd722693f3a7.

Mounting C:\Projects\my-api\api-main\.aws-sam\build\LambdaFunction as /var/task:ro,delegated, inside runtime container
START RequestId: 71de187e-ce8d-4fb0-9ee1-58b5d578b330 Version: $LATEST
LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html
[ERROR] Runtime.ImportModuleError: Unable to import module 'main': cannot import name 'DEPRECATED_SERVICE_NAMES' from 'botocore.docs' (/opt/python/botocore/docs/__init__.py)
Traceback (most recent call last):
END RequestId: 3df868d8-6059-49c0-b401-e6d20754a442
REPORT RequestId: 3df868d8-6059-49c0-b401-e6d20754a442  Init Duration: 0.16 ms  Duration: 638.28 ms     Billed Duration: 639 ms Memory Size: 128 MB     Max Memory Used: 128 MB
{"errorMessage": "Unable to import module 'main': cannot import name 'DEPRECATED_SERVICE_NAMES' from 'botocore.docs' (/opt/python/botocore/docs/__init__.py)", "errorType": "Runtime.ImportModuleError", "stackTrace": []}`

I only have python version 3.8.10 installed.It used to work and now it doesn't work anymore.

Can anyone help me? Thanks!

0

There are 0 best solutions below