[英]Deploying Flask Application with pandas to Elastic Beanstalk
I a new to AWS. 我是AWS的新手。 Trying to deploy a simple flask application to AWS.
尝试将简单的flask应用程序部署到AWS。 I had no problem until I included pandas package.
直到包括熊猫包装,我才没有问题。
No even with the simplest application I get errors such as "your requirements.txt file is invalid". 即使使用最简单的应用程序也无法,但是我得到诸如“您的requirements.txt文件无效”之类的错误。
My test application is very simple: There are only two files in the folder application.py and requirements.txt. 我的测试应用程序非常简单:文件夹application.py和requirements.txt中只有两个文件。
from flask import Flask
from pandas import DataFrame
application = Flask(__name__)
@application.route("/")
def home():
return "hello pandas "
if __name__ == '__main__':
application.run()
Requirements file was created with pip freeze 需求文件是通过冻结冻结创建的
boto3==1.4.1
botocore==1.4.60
click==6.6
docutils==0.12
Flask==0.11.1
itsdangerous==0.24
Jinja2==2.8
jmespath==0.9.0
MarkupSafe==0.23
numpy==1.11.2
pandas==0.19.0
python-dateutil==2.5.3
pytz==2016.7
s3transfer==0.1.7
six==1.10.0
I have seen posts recommending choosing a bigger instance type than t1.micro that is default. 我看过一些帖子,建议您选择比默认的t1.micro更大的实例类型。 I have done that as follows:
我这样做如下:
eb create -i m4.large --timeout 100
but still no luck. 但仍然没有运气。
If anyone has deployed flask application that uses pandas to AWS successfully please advise on the best way to do that. 如果有人成功将使用熊猫的flask应用程序部署到AWS,请提供最佳方法。 Thank you.
谢谢。
I have had the same problem deploying a django app to EBS with pandas, and the issue was that there are certain C libraries that need to be installed first. 我在使用熊猫将django应用程序部署到EBS时遇到了同样的问题,问题是必须首先安装某些C库。 Just add this in your .ebextensions folder:
只需将其添加到您的.ebextensions文件夹中:
commands:
install_devtools:
command: yum -y groupinstall 'Development tools'
Heads up, I believe that this will only work on sizes T2 small and above. 注意,我相信这仅适用于T2以上的尺寸。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.