Es ist ziemlich schwierig, Python requirements.txt zu einer PHP-Anwendung auf Elastic Beanstalk zu installieren.Fehler bei der Installation von lxml zu Elastic Beanstalk
Anfangs hatte ich die Fähigkeit in Frage gestellt Deploy multiple platforms to Elastic Beanstalk (PHP/Python). Zwar ist dies nicht möglich, aus dem Kasten heraus ist, ist es möglich, pre-install commands via .ebextentions
Dies führte zur Schaffung eines .ebextentions/install_python_requirements.config
container_commands:
python_req:
command: 'pip install -r /var/app/ondeck/requirements.txt'
Das Problem ist, jetzt lxml
, eine Abhängigkeit der Anforderungen laufen , schlägt während des Bereitstellungsvorgangs regelmäßig fehl. Seltsamerweise wird ssh
direkt in die EC2-Instanz dann ausgeführt pip install -r requirements.txt
wird ohne Problem abgeschlossen.
Warum erfolgt die abhängige Installation über direkten Zugriff ssh
, aber fehlgeschlagen während der Bereitstellung mit eb deploy
und die install_python_requirements.config
?
Failure in /var/log/eb-activity.log
creating build/temp.linux-x86_64-2.7/src/lxml
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 -I/usr/include/libxml2 -I/tmp/pip-build-A6NhcA/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
gcc: error trying to exec 'cc1': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-A6NhcA/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gSsRbZ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-A6NhcA/lxml
(ElasticBeanstalk::ExternalInvocationError)