سؤال

I have a auto scaling Elastic Beanstalk app running Python where I want to use PIL. When I do, it says that my jpeg decoder is missing and that I need to install libjpeg.

So I follow AWS official guides for "configuration files" here:

But I can't get it working.

If I understand the guides correctly I should set up a directory called .ebextensions in my application folder. Inside my .ebextensions I should set up a foo.config file. In my case I name it python.config.

In this file I'm suppose to execute commands. The code of my .config file is:

packages:
  yum:
    libjpeg-devel: '6b'

I deploy my app and I can see in my Log Snapshots that its inflating and creating the file like this:

-------------------------------------
/var/log/eb-tools.log
-------------------------------------
creating: /opt/python/ondeck/app/.ebextensions/
inflating: /opt/python/ondeck/app/.ebextensions/python.config  
inflating: /opt/python/ondeck/app/application.py  
...

However, I can't find anything about actually executing the commands. I've been searching my log for "yum", "python.config", "jpeg", "libjpeg" and so on without any relevant traces. I restart the application server but still I get the same messages saying libjpeg is missing.

I have seen other people asking similar questions, about config files not working. But I have yet to see any answer.

هل كانت مفيدة؟

المحلول

I ran into the same issue, instead of setting up a completely new Elastic Beanstalk app, I connected to the EC2 instance via SSH and re-installed PIL (or Pillow).

On EC2 instance, I ran the following commands:

source /opt/python/run/venv/bin/activate
pip uninstall PIL
pip install PIL

Now PIL supports jpeg encoding =)

نصائح أخرى

I "fixed" this by setting up a completely new Elastic Beanstalk app and deploying the exact same application there. It then successfully installed the libjpeg package.

I was never able to find out the answer to why it didnt work on the first Elastic Beanstalk App. But maybe it had something to do with PIL was first installed and then it couldnt install libjpeg after.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top