I have deployed a python code in Google App Engine.In my code,tried to import firebase_admin,but it shows following error,
import firebase_admin ImportError: No module named firebase_admin hello.py
import firebase_admin from firebase_admin import credentials from firebase_admin import db I tried simple python code using Terminal: hello.py
import firebase_admin print firebase_admin Output in terminal:
~/Desktop$ python hello.py <module 'firebase_admin' from '/usr/local/lib/python2.7/dist-packages/firebase_admin/__init__.pyc'> 96 Answers
Install "firebase-admin" by pip3 install firebase-admin
Firstly, confirming your package path of executing program.
Secondly, Perferences --> Project Interpreter ,Make sure the Package install correct path 
Anyway, you should use correct python which is installed the package
Per Hiranya Jayathilaka's comment, third party libraries must be vendored into Google App Engine applications.
I was trying to connect cloud firestore through python-admin-sdk using Visual Studio Code which gave me same error
Working environment:
- Ubuntu 20.04
- Python 3.8.5
- firebase-admin 5.0.0
- Visual Studio Code
Resolution by re-installing PyLance extension in Visual Studio Code.
After unsuccessfully trying all incarnations of pip to install firebase_admin, what worked for me was adding firebase_admin in the requirements.txt file then run pip install -r requirements.txt
For some reason beyond my understanding, firebase_admin appears to work when installed by referencing the requirements.txt file but not when running pip directly.
update your
firebase_admin
to the latest version . this will solve the issue . if nit rename
firebase.py
to some other name... Its working
just not use
firebase.py
as a name for your project and it will work
0