Nei*_*eil 7 python google-app-engine google-app-engine-python app-engine-flexible
我正在尝试部署appengine flex python应用程序,但在部署后在Stackdriver日志stderr中获取以下内容
File "/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
File "/home/vmagent/app/my_service/entry_point.py", line 5, in <module>
import flask_restful as restful
ImportError: No module named flask_restful
Run Code Online (Sandbox Code Playgroud)
第5行的entry_point.py有
import flask_restful as restful
Run Code Online (Sandbox Code Playgroud)
而我的requirements.txt有
Flask-RESTful==0.3.6
gunicorn==19.7.1
Run Code Online (Sandbox Code Playgroud)
不知道为什么它还在抱怨Flask-Restful
Tre*_*box 15
导入错误:没有名为 flask_restful 的模块
似乎你没有安装flask_restful,安装运行:
pip install flask-restful
Run Code Online (Sandbox Code Playgroud)
在您的终端中,然后运行您的应用程序。
文档:https : //flask-restful.readthedocs.io/en/latest/installation.html