gpt4 book ai didi

python - 导入错误 : No module named flask_restful

转载 作者:太空狗 更新时间:2023-10-29 22:24:24 29 4
gpt4 key购买 nike

我正在尝试部署 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

entry_point.py第5行有

import flask_restful as restful

而我的requirement.txt有

Flask-RESTful==0.3.6
gunicorn==19.7.1

不确定为什么它仍然提示 Flask-Restful

最佳答案

ImportError: No module named flask_restful

似乎你没有安装flask_restful,安装运行:

pip install flask-restful

在您的终端中,然后运行您的应用。

文档:https://flask-restful.readthedocs.io/en/latest/installation.html

关于python - 导入错误 : No module named flask_restful,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51213822/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com