简体   繁体   English

将带有熊猫的Flask应用程序部署到Elastic Beanstalk

[英]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中只有两个文件。

Application.py is basic: Application.py是基本的:

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

Werkzeug==0.11.11 WERKZEUG == 0.11.11

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.

相关问题 使用 CLI 将 flask 应用程序部署到弹性 beanstalk 时出现 502 错误 - 502 error deploying flask application to elastic beanstalk using CLI Elastic Beanstalk Flask 应用程序 - 没有名为“pandas_datareader”的模块 - Elastic Beanstalk Flask application - No module named 'pandas_datareader' Elastic Beanstalk Flask应用程序上的HTTPS - HTTPS on Elastic Beanstalk Flask application 使用 Elastic Beanstalk 部署 Flask 应用程序时遇到问题 - Trouble deploying Flask app using Elastic Beanstalk 在 AWS Elastic Beanstalk 中部署 Flask 应用程序 - Deploying Flask App in AWS Elastic Beanstalk ModuleNotFoundError:在 AWS Elastic Beanstalk 上部署 Flask 应用程序时没有名为“应用程序”的模块 - ModuleNotFoundError: No module named 'application' when deploying Flask app on AWS Elastic Beanstalk Elastic Beanstalk Flask应用程序-找不到静态文件 - Elastic Beanstalk Flask Application - Static files not found 如何在AWS Elastic Beanstalk上部署Flask与运行脚本不同? - How is Deploying Flask on AWS Elastic Beanstalk different from running script? 在Elastic Beanstalk上使用Docker部署Flask应用程序:资源创建取消错误 - Deploying Flask app with Docker on Elastic Beanstalk: resource creation cancelled error 通过与S3交互的Elastic Beanstalk部署Flask应用 - Deploying Flask app to via Elastic Beanstalk which interacts with S3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM