2017-08-07 129 views
1

我已经部署在谷歌应用程序Engine.In我的代码Python代码,试图导入firebase_admin,但它显示了以下错误,Python的火力地堡问题上没有模块名为firebase_admin

import firebase_admin 
ImportError: No module named firebase_admin 

hello.py

import firebase_admin 
from firebase_admin import credentials 
from firebase_admin import db 

我想简单的Python代码使用终端: hello.py

import firebase_admin 
print firebase_admin 

输出端子:

~/Desktop$ python hello.py 
<module 'firebase_admin' from '/usr/local/lib/python2.7/dist-packages/firebase_admin/__init__.pyc'> 
+1

您是否安装了包装? 'pip install firebase-admin' – Thomas

+0

@ThomasMey是的,我安装了sudo pip install firebase-admin ...它成功安装了..但仍然出现这个错误... – Ramprasad

+0

@ThomasMey我在我的Linux中使用PyCharm ...是的在本地机器上安装firebase-admin的任何问题? – Ramprasad

回答

0

更新您的

firebase_admin

到最新版本。这将解决问题。 如果NIT重命名

firebase.py

一些其他的名字......它的工作

只是没有使用

firebase.py

作为你的项目的名称,它会工作

0

首先,确认你的包执行程序的路径。

enter image description here

其次,Perferences - >项目翻译,确保包安装正确的路径 enter image description here

反正,你应该使用其安装包enter image description here

正确的python