the _imagingft c module is not installed amazon linux elasticbeanstalk

Viewed 92

I have my app installed on AWS ElasticBeanstalk and it recently started giving me the following error:

The _imagingft C module is not installed

Traceback:

File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/python/current/app/grn/views.py", line 256, in get
    a = ean.save(item['bar'], options=d)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/barcode/base.py", line 65, in save
    output = self.render(options)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/barcode/codex.py", line 257, in render
    return Barcode.render(self, options, text)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/barcode/base.py", line 105, in render
    raw = self.writer.render(code)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/barcode/writer.py", line 227, in render
    self._callbacks["paint_text"](xpos, ypos)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/barcode/writer.py", line 372, in _paint_text
    font = ImageFont.truetype(self.font_path, self.font_size * 2)
  File "/opt/python/run/venv/local/lib64/python3.6/site-packages/PIL/ImageFont.py", line 855, in truetype
    return freetype(font)
  File "/opt/python/run/venv/local/lib64/python3.6/site-packages/PIL/ImageFont.py", line 852, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/opt/python/run/venv/local/lib64/python3.6/site-packages/PIL/ImageFont.py", line 187, in __init__
    if core.HAVE_RAQM:
  File "/opt/python/run/venv/local/lib64/python3.6/site-packages/PIL/ImageFont.py", line 44, in __getattr__
    raise ImportError("The _imagingft C module is not installed")

Exception Type: ImportError at /grn-print/
Exception Value: The _imagingft C module is not installed

In my requirements.py I have the following modules:

asgiref==3.2.7
Django==3.0.5
django-cors-headers==3.2.1
djangorestframework==3.11.0
djangorestframework-simplejwt==4.4.0
PyJWT==1.7.1
pytz==2020.1
sqlparse==0.3.1
psycopg2==2.8.6
djangorestframework-jwt
django-storages
boto3==1.11.4
zplgrf
reportlab
pandas
python-barcode
pretty_html_table
folium
googlemaps
pyexcel
pyexcel_xls
openpyxl
gunicorn
Pillow==8.4.0

I found out that using freetype-devel might help but it's still the same

01_packages.config

packages:
  yum:
    git: []
    postgresql93-devel: []
    libjpeg-turbo-devel: []
    freetype-devel: []
    libjpeg-turbo-devel: []

commands:
    setuptools:
      command: /opt/python/run/venv/bin/pip install setuptools --upgrade

What do I need to do to make this work?

1 Answers
Related