【发布时间】:2021-11-21 03:31:29
【问题描述】:
我在 AWS ElasticBeanstalk 上安装了我的应用程序,它最近开始出现以下错误:
_imagingft C 模块未安装
追溯:
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
在我的 requirements.py 中,我有以下模块:
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
我发现使用freetype-devel 可能会有所帮助,但还是一样
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
我需要做什么才能完成这项工作?
【问题讨论】:
标签: python django amazon-elastic-beanstalk python-imaging-library