elasticbeanstalk gcc和python-devel安装

时间:2017-08-02 14:27:57

标签: python pandas amazon-web-services elastic-beanstalk

我试图运行一个具有/** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Notifies user of an error in the java code * * @param e Exception generated * @return HTML as String */ private String returnError(Exception e) { e.printStackTrace(); String returnString = "<html><body><h1>" + e.getMessage() + "</h1></body></html>"; return returnString; } 依赖关系的烧瓶应用程序。没有安装python-devel,就无法安装pandas。所以首先我需要根据这个帖子安装gcc-c ++和python devel:'gcc' failed during pandas build on AWS Elastic Beanstalk

现在,我的pandas看起来像是:

.elasticbeanstalk/config.yml

但是在成功branch-defaults: default: environment: flask-env group_suffix: null global: application_name: flask-sample-app branch: null default_ec2_keyname: flask-sample-app default_platform: Python 3.4 default_region: eu-west-1 include_git_submodules: true instance_profile: null platform_name: null platform_version: null profile: null repository: null sc: null workspace_type: Application packages: yum: gcc-c++: [] python-devel: [] 命令后,我通过eb deploy连接到它,看到它没有安装。我的config.yml是否正确?

2 个答案:

答案 0 :(得分:0)

Pandas和NumPy似乎无论你采取什么方式部署某些东西都会给你带来最多麻烦。我自己还没有使用过弹性beanstalk,但直接在服务器和docker上完成了。

可以看到你所拥有的和对我有用的一个区别。根据{{​​3}}

,我认为你需要gcc和g ++

所以也许在你的最后几行之前添加一行:

packages:
  yum:
    gcc: []
    gcc-c++: []
    python-devel: []

我只是翻译其他地区的工作。

答案 1 :(得分:0)

当我在.ebextensions而不是.elasticbeanstalk创建yaml文件时,它有效。我只是将yaml文件放在错误的目录下。

.elasticbeanstalk / pandas.yml:

packages:
  yum:
    gcc-c++: []
    python3?-devel.x*: []

我在尝试安装python-devel: []时遇到错误:

  

实例上的命令失败。返回码:1输出:Yum没有可用于安装的python-devel

因此,在我的情况下,正确的devel包名称是'python27-devel.x86_64'或'python35-devel.x86_64'

https://forums.aws.amazon.com/thread.jspa?threadID=233268

How to install python3-devel on red hat 7