elasticbeanstalk gcc and python-devel installation

2019-08-11 01:10发布

问题:

I'm trying to run a flask application which has pandas dependency. Without having python-devel installed, pandas cannot be installed. So first I need to install gcc-c++ and python devel according to this thread: 'gcc' failed during pandas build on AWS Elastic Beanstalk

Now, my .elasticbeanstalk/config.yml looks like:

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: []

But after successful eb deploy command, I connect to it via eb ssh and see that it wasn't installed. Is my config.yml correct?

回答1:

Pandas and NumPy seem to give the most trouble whatever way you go to deploy something. I haven't used elastic-beanstalk myself but have done it direct on servers and in docker.

Can see one difference with what you have and what worked for me. I think you need both gcc and g++ as per this

So perhaps add a line before those last lines of yours:

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

Am just translating accross what worked in another area.



回答2:

When I created a yaml file in .ebextensions instead of .elasticbeanstalk, it worked. I was simply putting the yaml file under the wrong directory.

.elasticbeanstalk/pandas.yml:

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

I got error while trying to install python-devel: []:

Command failed on instance. Return code: 1 Output: Yum does not have python-devel available for installation

So the correct devel package name, in my case, is either 'python27-devel.x86_64' or 'python35-devel.x86_64'

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

How to install python3-devel on red hat 7