19

Getting the following error when trying to install Pandas (0.16.0), which is in my requirements.txt file, on AWS Elastic Beanstalk EC2 instance:

  building 'pandas.msgpack' extension

  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -D__LITTLE_ENDIAN__=1 -Ipandas/src/klib -Ipandas/src -I/opt/python/run/venv/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c pandas/msgpack.cpp -o build/temp.linux-x86_64-2.7/pandas/msgpack.o

  gcc: error trying to exec 'cc1plus': execvp: No such file or directory

  error: command 'gcc' failed with exit status 1

I'm running on 64bit Amazon Linux 2015.03 v1.3.0 running Python 2.7 and previously ran into this same error on a t1.micro instance, which was resolved when I change to a m3.medium, but I'm running an m3.xlarge so can't be a memory issue.

I have also ensured that gcc is installed as a package in .ebextensions/00_gcc.config:

packages:
   yum:
      gcc: []
      gcc-c++: []
greenafrican
  • 2,276
  • 4
  • 23
  • 36
  • Had this issue for a few days now. Rebuilding the environment and then activating x-ray and enhanced health/logging resolved this issue. Although i have no idea why there is a connection. – Andrey Bulezyuk May 06 '20 at 09:56

5 Answers5

20

For pandas being compiled on Elastic Beanstalk, make sure to have both packages: gcc-c++ and python-devel

packages:
   yum:
      gcc-c++: []
      python-devel: []
linqu
  • 8,620
  • 6
  • 44
  • 57
-1

Install python-dev

sudo apt-get install python-dev

For python3

sudo apt-get install python3-dev
itzMEonTV
  • 17,660
  • 3
  • 31
  • 40
-1

on ec2 instances if you run into gcc error; try this

  1. sudo yum install gcc python-setuptools python-devel postgresql-devel

  2. sudo su -

  3. sudo pip install

-1

I had to upgrade amazon's EC2 pip. You can do this by editing the .config file in .ebextensions:

sh commands: 00_update_pip: command: "/opt/python/run/venv/bin/pip install --upgrade pip"

João Abrantes
  • 3,897
  • 2
  • 25
  • 58
-1

I solved this issue by ssh'ing in to the EBS machine and updating pip

pip install -U pip
imeckr
  • 1
  • this might not be the wisest thing to do in case the EB machine at some point terminates, since those manual changes won't persist after reboot – arturomp Mar 07 '18 at 03:15