I've faced an error cannot import name 'EntryPoints' from 'importlib_metadata' inside the lambda function.
Investigation
I have found aws/aws-lambda-python-runtime-interface-client#61 and aws/aws-lambda-python-runtime-interface-client#61
Problem from awslambdaric which depends on an old version of importlib-metadata (2.0.0) which is overriding the version use by
Switching to python 3.8 fixed the issue.