' GCC'在使用AWS Elastic Beanstalk的pandas构建期间失败

时间:2015-04-08 13:30:46

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

尝试在AWS Elastic Beanstalk EC2实例上安装我的requirements.txt文件中的Pandas(0.16.0)时出现以下错误:

  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

我正在运行64bit Amazon Linux 2015.03 v1.3.0 running Python 2.7并且先前在t1.micro实例上遇到了同样的错误,当我更改为m3.medium时解决了这个错误,但我正在运行m3.xlarge所以可以不是记忆问题。

我还确保将gcc作为包安装在.ebextensions/00_gcc.config

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

5 个答案:

答案 0 :(得分:15)

对于在Elastic Beanstalk上编译的pandas,请确保同时包含两个包:gcc-c++ python-devel

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

答案 1 :(得分:0)

安装python-dev

sudo apt-get install python-dev

python3

sudo apt-get install python3-dev

答案 2 :(得分:-1)

如果遇到gcc错误,请在ec2实例上

;试试这个

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

  2. sudo su -

  3. sudo pip install

答案 3 :(得分:-1)

我不得不升级亚马逊的EC2点。您可以通过编辑.ebextensions:

中的.config文件来完成此操作

viewDidLoad() { let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(close)) gestureRecognizer.cancelsTouchesInView = false gestureRecognizer.delegate = self view.addGestureRecognizer(gestureRecognizer) } func close() { dismiss(animated: true, completion: nil) }

答案 4 :(得分:-1)

我通过ssh进入EBS机器并更新pip来解决这个问题

pip install -U pip