AWS Lambda to Firestore error: cannot import name 'cygrpc'

前端 未结 2 400
长情又很酷
长情又很酷 2021-01-14 01:25

On my AWS Lambda Python 3.6 function I\'d like to use Google Firestore (Cloud Firestore BETA) for caching purposes, but as soon as I add

from google.cloud im         


        
2条回答
  •  生来不讨喜
    2021-01-14 02:09

    Ran into same issue, i solved it by using the plugin serverless-python-requirements for serverless framework and passing:

    pythonRequirements:
        dockerizePip: true
    

    Essentially this installs your c-based packages (and all other packages) in a docker container where it would work and then symlinks them to your lambda fn.

    A helpful guide can be found on: https://serverless.com/blog/serverless-python-packaging/

    Plugin: https://github.com/UnitedIncome/serverless-python-requirements

提交回复
热议问题