Search code examples
pythonamazon-web-servicesaws-lambda

"Unable to import module 'lambda_function': cannot import name 'cygrpc' from 'grpc._cython' (/var/task/grpc/_cython/__init__.py)"


I am working on aws lambda function, i install the package but i got error

Unable to import module 'lambda_function': cannot import name 'cygrpc' from 'grpc._cython' (/var/task/grpc/_cython/init.py)

How to solve this type of error?


Solution

  • Are you trying to import it in code without haveing it installed on the lambda container? If you gonna use none std libs you should have you function and its libs installed locally and when zip it and upload it to Lambda.

    Docs: https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html