--- 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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…