无法将Flask应用程序部署到Elastic Beanstalk而不会出现500错误

时间:2015-03-18 22:46:56

标签: amazon-web-services flask mod-wsgi elastic-beanstalk

我已将我的Flask应用推送到ElasticBeanstalk,但我在每个网页上收到500个错误,并Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module.显示/var/log/httpd/error_log

这是/var/log/httpd/error_log中的完整堆栈跟踪:

[Wed Mar 18 22:02:36.815358 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] mod_wsgi (pid=21701): Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module.
[Wed Mar 18 22:02:36.815389 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] mod_wsgi (pid=21701): Exception occurred processing WSGI script '/opt/python/current/app/application.py'.
[Wed Mar 18 22:02:36.815410 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] Traceback (most recent call last):
[Wed Mar 18 22:02:36.815435 2015] [:error] [pid 21701] [remote 50.23.**2.10:0]   File "/opt/python/current/app/application.py", line 5, in <module>
[Wed Mar 18 22:02:36.815466 2015] [:error] [pid 21701] [remote 50.23.**2.10:0]     from charts import *
[Wed Mar 18 22:02:36.815478 2015] [:error] [pid 21701] [remote 50.23.**2.10:0]   File "/opt/python/current/app/charts.py", line 6, in <module>
[Wed Mar 18 22:02:36.815494 2015] [:error] [pid 21701] [remote 50.23.**2.10:0]     from scipy.stats import linregress
[Wed Mar 18 22:02:36.815514 2015] [:error] [pid 21701] [remote 50.23.**2.10:0] ImportError: No module named scipy.stats

这是application.py的第一部分:

from flask import Flask, jsonify, request
import os
import logging
from logging import StreamHandler
from charts import *

application = app = Flask(__name__)

我将我的烧瓶应用程序分配给application对象,这是我需要做的所有文档。我知道我做错了什么?

谢谢!

0 个答案:

没有答案