Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

python - Firebase Admin SDK with Flask throws error No module named 'firebase_admin'

--- Question closed

It was my mistake, my uWSGI startup script switches to a different virtualenv.

--- Original question

I'm trying to publish push notifications from my Flask app server to Android APP.

Server environment (dev):

  • Mac OS Sierra
  • Flask 1.0.2
  • Python 3.6.5
  • firebase-admin SDK 2.17.0 (the latest version)

When running code as Flask application for initialising the SDK, import statement throws error:

import firebase_admin

ModuleNotFoundError: No module named 'firebase_admin'

However, running above import statement from Python interpreter mode gives no error. PyCharm is also able to recognize the firebase_admin module. All three setups (Flask app, interpreter, PyCharm) use the same virtualenv.

I had tried few older versions of SDK but error persists. Any clue?

--- More details

The module was installed from command line within virtualenv using command pip install firebase-admin.

The error occurs when running the code as Flask+uWSGI app from command line, within the same virtualenv. pip freeze shows that the module is indeed present.

--- Question closed

It was my mistake, my uWSGI startup script switches to a different virtualenv.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...