问题
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'>
回答1:
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
回答2:
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
来源:https://stackoverflow.com/questions/45553501/python-firebase-issue-no-module-named-firebase-admin