将Flask部署到AWS失败,request.txt返回了非零退出状态1

时间:2020-10-08 18:25:06

标签: python amazon-web-services flask amazon-elastic-beanstalk web-deployment

部署到AWS失败,Requirement.txt返回非零退出状态1

尝试在使用Python 3.6的AWS Beanstalk上部署Flask应用程序时出现以下错误:

Flask deploy ERROR

我检查了类似的帖子AWS Elastic Beanstalk - python - Your requirements.txt is invalid,他们建议在.ebextensions目录中创建一个.config文件,但是在Mac和Windows上工作时,我无法命名文件夹.ebextensions如果您尝试尝试,则会显示向上窗口。我在终端上创建了此目录和文件,然后尝试将整个内容也压缩到那里(因为.ebextensions不在Finder中显示),但是.ebextensions文件夹为空。

我正在尝试一个非常简单的Flask应用程序,这是我的application.py

#Basic modules for a Flask app to work (set Flask app, return HTML template for specific @application.route, redirect to a different
#@application.route, generate URL to a given endpoint).
from flask import Flask, render_template, redirect, url_for

#Set Flask application object
application = Flask(__name__) 
application.config['SECRET_KEY'] = 'ants' 

@application.route('/', methods=['GET', 'POST'])
@application.route('/home', methods=['GET', 'POST']) 
def index():
    return render_template('project_homepage.html')

if __name__ == '__main__':
    application.run()

我的project_homepage.html(应该返回蓝色背景),位于模板文件夹中

<doctype html>
<html lang="en">
  <head>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.1/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/js/jquery.dataTables.min.js"></script>
<title> Network Visualizer </title>
</head>






<body style="background-color:#dee8eb;border: 1px solid #7ea4b3">
  
<div style="background-color:#dee8eb;width:100%;height:20px " class="container"></div>




</body>

</html>
</doctype>

和我的requirements.txt(由于我的实际应用程序要复杂得多,所以有很多软件包,但是我正在尝试一个基本的软件包来了解AWS的要旨)


aniso8601==8.0.0
appnope==0.1.0
asn1crypto==1.2.0
attrs==19.3.0
backcall==0.1.0
beautifulsoup4==4.9.1
bower==0.0.0
cairocffi==1.1.0
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
chart-studio==1.1.0
Click==7.0
community==1.0.0b1
conda==4.8.3
conda-package-handling==1.6.0
configparser==5.0.0
cryptography==2.8
cycler==0.10.0
decorator==4.4.2
django-mathfilters==1.0.0
Flask==1.1.1
Flask-Cors==3.0.8
Flask-HTTPAuth==4.1.0
Flask-RESTful==0.3.8
Flask-WTF==0.14.2
future==0.18.2
idna==2.8
importlib-metadata==1.6.0
ipython==7.13.0
ipython-genutils==0.2.0
itsdangerous==1.1.0
jedi==0.16.0
Jinja2==2.11.0
kiwisolver==1.1.0
lxml==4.5.2
MarkupSafe==1.1.1
matplotlib==3.2.1
more-itertools==8.2.0
networkx==2.4
npm==0.1.1
numpy==1.19.0
optional-django==0.1.0
packaging==20.3
pandas==1.0.0
parso==0.6.2
pexpect==4.8.0
pickleshare==0.7.5
plotly==4.5.0
pluggy==0.13.1
prompt-toolkit==3.0.4
psutil==5.6.7
ptyprocess==0.6.0
py==1.8.1
pycosat==0.6.3
pycparser==2.19
Pygments==2.6.1
pyOpenSSL==19.0.0
pyparsing==2.4.6
pyreadr==0.2.9
PySocks==1.7.1
pytest==5.4.1
python-dateutil==2.8.1
python-louvain==0.14
pytz==2019.3
pyvis==0.1.7.0
requests==2.22.0
retrying==1.3.3
ruamel-yaml==0.15.46
scikit-network==0.18.0
scipy==1.4.1
seaborn==0.10.0
simple-http-server==0.1.7
simplegeneric==0.8.1
six==1.12.0
soupsieve==2.0.1
SQLAlchemy==1.3.13
timeloop==1.0.2
tqdm==4.36.1
traitlets==4.3.3
tzlocal==2.0.0
urllib2-file==0.2.1
urllib3==1.24.2
wcwidth==0.1.9
Werkzeug==0.16.1
WTForms==2.2.1
xlrd==1.2.0
zipp==3.1.0

任何帮助将不胜感激!谢谢。

安德鲁

0 个答案:

没有答案