firebase / firebase-admin-python

Firebase Admin Python SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
1.03k stars 321 forks source link

AWS lambda Python functions gives error to install the "google-cloud-firestore" module, but is already installed #634

Open anialamo opened 2 years ago

anialamo commented 2 years ago

Operating System version: AWS Python lambda Firebase SDK version: firebase-admin 5.2.0 Firebase Product: google cloud firestore Python version: 3.9

Hi I have an AWS Lambda in Python 3.9 (now regenerated in AWS functions console),I have installed in my local aws folder firebase-admin & dependencies:

pip install --target . firebase-admin==5.2.0

This installation gives me this error:

image

And finally I have implemented my Python AWS lambda, and upload to AWS lambda as ZIP file a package to the AWS code function console. When I tried to execute my testing in the Python Lambda, this gives me this error:

{
  "errorMessage": "Unable to import module 'lambda_function': Failed to import the Cloud Firestore library for Python. Make sure to install the \"google-cloud-firestore\" module.",
  "errorType": "Runtime.ImportModuleError",
  "stackTrace": []
}

I also installed in my local directory the grpcio module, before to upload ZIP file in AWS function console, with this command:

pip install --target . grpcio

And finally upload all my directory in a package to the AWS function console.

But the same error is displayed when I execute a test in AWS cloud function.

{
  "errorMessage": "Unable to import module 'lambda_function': Failed to import the Cloud Firestore library for Python. Make sure to install the \"google-cloud-firestore\" module.", ....
}

This is my full directory:

image

What can I do to solve this error? & made available google-cloud-firestore works fine in my AWS Lambda Python?

Thanks!

google-oss-bot commented 2 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

CameronTurner commented 2 years ago

This one is doing my head in as well. Have wasted a good 2-3 days trying to load every library under the sun. Would really appreciate someone looking into this.

I have the exact same issue as above

ghost commented 2 years ago

https://stackoverflow.com/questions/48264536/importerror-failed-to-import-the-cloud-firestore-library-for-python I have seen this issue here, may be this link will help you out.

CameronTurner commented 2 years ago

Thanks, had tried that one but no luck.

We ended up giving up and migrating off Firebase in the end. Was just too hard to deal with.

On Tue, 13 Sept 2022, 4:06 pm Monish-0101, @.***> wrote:

https://stackoverflow.com/questions/48264536/importerror-failed-to-import-the-cloud-firestore-library-for-python I have seen this issue here, may be this link will help you out.

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-admin-python/issues/634#issuecomment-1244941708, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACR6PFQVCVFRK3BZHHHP7BTV6AKVDANCNFSM55WTXNYA . You are receiving this because you commented.Message ID: @.***>

jonathanedey commented 1 month ago

Hi @anialamo, are you still experiencing this issue with newer versions of the SDK?