Firebase on AWS Lambda Import Error

混江龙づ霸主 提交于 2021-02-10 20:14:02

问题


I am trying to connect Firebase with an AWS Lambda. I am using their firebase-admin sdk. I have installed and created the dependancy package as described here. But I am getting this error on Lambda:

 Unable to import module 'index':
 Failed to import the Cloud Firestore library for Python.
 Make sure to install the "google-cloud-firestore" module.

I have previously also tried setting up a similar function using node.js but I received an error message because GRPC was not configured. I think that this error message might be stemming from that same problem. I don't know how to fix this. I have tried:

pip install grpcio -t path/to/...

and installing google-cloud-firestore, but neither fixed the problem. When I run the code from my terminal, I get no errors.


回答1:


Part of the problem here is that grpcio compiles a platform specific dynamic module: cygrpc.cpython-37m-darwin.so (in my case). According to this response you cannot import dynamic modules in a zip file: https://stackoverflow.com/a/58140801



来源:https://stackoverflow.com/questions/51391458/firebase-on-aws-lambda-import-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!