Ошибка AWS EB libxml2 и libxslt

В качестве фона я использую macOS и развертываю приложения Python в AWS Elastic Beanstalk (EB).

Моему приложению не требуется libxml2-devel или libxslt-devel для локального запуска, но при отправке в Amazon EC2 и libxml2-devel, и libxslt-devel по какой-то причине становятся зависимостями. Через SSH я могу установить оба, используя sudo yum install -y libxml2-devel libxslt-devel. Это проблема, которую я могу исправить, или это проблема с AWS EB?

Кроме того, я устал удалять, а затем устанавливать как libxslt, так и libxml2, чтобы получить привязки libxml2 Python, и это не решило проблему.

brew uninstall libxslt
brew uninstall libxml2
brew install libxml2 --with-python
brew link --force libxml2
brew install libxslt
brew link --force libxslt

Ниже приведено сообщение об ошибке из консоли работоспособности AWS:

Application update failed at 2017-02-21T08:15:39Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed.

Requirement already satisfied (use --upgrade to upgrade): appdirs==1.4.0 in /opt/python/run/venv/lib/python2.7/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): Django==1.9.2 in /opt/python/run/venv/lib/python2.7/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 2))
Collecting lxml==3.7.2 (from -r /opt/python/ondeck/app/requirements.txt (line 3))
Using cached lxml-3.7.2.tar.gz
Collecting packaging==16.8 (from -r /opt/python/ondeck/app/requirements.txt (line 4))
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting pyparsing==2.1.10 (from -r /opt/python/ondeck/app/requirements.txt (line 5))
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Collecting requests==2.13.0 (from -r /opt/python/ondeck/app/requirements.txt (line 6))
Using cached requests-2.13.0-py2.py3-none-any.whl
Collecting six==1.10.0 (from -r /opt/python/ondeck/app/requirements.txt (line 7))
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: lxml, six, pyparsing, packaging, requests
Running setup.py install for lxml
Complete output from command /opt/python/run/venv/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-DmDEWN/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Wqejfh-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python2.7/lxml:
Building lxml version 3.7.2.
Building without Cython.
ERROR: /bin/sh: xslt-config: command not found

** make sure the development packages of libxml2 and libxslt are installed **

In file included from src/lxml/lxml.etree.c:515:
src/lxml/includes/etree_defs.h:14:31: error: libxml/xmlversion.h: No such file or directory
src/lxml/includes/etree_defs.h:16:4: error: #error the development package of libxml2 (header files etc.) is not installed correctly
src/lxml/includes/etree_defs.h:23:32: error: libxslt/xsltconfig.h: No such file or directory
src/lxml/includes/etree_defs.h:25:4: error: #error the development package of libxslt (header files etc.) is not installed correctly
src/lxml/includes/etree_defs.h:186:25: error: libxml/tree.h: No such file or directory
In file included from src/lxml/lxml.etree.c:515:
src/lxml/includes/etree_defs.h:188: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘xmlBuf’

person Fireycold    schedule 21.02.2017    source источник
comment
stackoverflow.com/questions/26878263 /   -  person Koga    schedule 21.02.2017
comment
Amazon Linux AMI не предоставляет RPM-пакет lxml, поэтому EB пытается установить lxml с помощью pip или easy_install, которые компилируют его из исходного кода. Либо добавьте пакеты разработки libxml2 в свою конфигурацию, либо попробуйте установить RPM lxml из другого источника.   -  person nwellnhof    schedule 23.02.2017