作为一些背景,我正在运行 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 的问题?
此外,为了获得 libxml2 Python 绑定,我已经厌倦了卸载然后安装libxslt
,但这并没有解决问题。libxml2
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’