1👍
Amazon’s elastic beanstalk does not currently support the apt-get package manager, so the default yum
must be used as seen in your config file. You could manually install pillow’s dependencies if you were to ssh into the server using
sudo yum install libxml2-devel libxslt-devel libjpeg-turbo-devel
(also note the different package names). Or preferably as additions to your config file so they are installed as needed on deployment.
packages:
yum:
# Your other non-python packages
libxml2-devel: []
libxslt-devel: []
libjpeg-turbo-devel: []
1👍
Try this for Ubuntu:
sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip
- [Django]-Why does using .latest() on an empty Django queryset return…nothing?
- [Django]-ListSerializer in Django Restful – When is it called?
- [Django]-Django-reversion and django-reversion-compare with User model
- [Django]-Upgrade Django project to Python3 – migrations fail
- [Django]-Celery : task executed so fast that cannot retrieve updated DB
0👍
I just had the exact same error when trying to install lxml
in an EC2 instance deployed using Elastic Beanstalk (AMI 2017.03), just like in the original question. The problem occurred only with Python 3.5, with Python 2.7 I could install it without trouble.
In my case, the problem was that GCC was not installed. Doing sudo yum install gcc
solved it.
I think the problem is that Amazon AMI repositories do not contain the binary package of the Python 3 bindings for libxml2. The bindings for Python 2.6 and 2.7 (python2X-lxml
) are available, that’s why everything works out of the box with Python 2. But when using pip-3.5
, pip does not find them and tries instead to install them from source, at which point it needs GCC.
The packages
section of my elastic beanstalk configuration file looks like this:
packages:
yum:
gcc: []
python35: []
python35-pip: []
python35-devel: []
libxml2-devel: []
libxslt-devel: []