Python Firebase issue No module named firebase_admin

狂风中的少年 提交于 2019-12-10 18:29:17

问题


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

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