При установке xhtmlpdf в python я столкнулся с проблемой при установке пакета reportlab

pip install xhtml2pdf

Я получил ошибку ниже:

PS D:\pace_at\PACE-AT-NewTech> docker exec pace_at pip install xhtml2pdf
Collecting xhtml2pdf
  Using cached xhtml2pdf-0.2.8-py3-none-any.whl (256 kB)
Collecting arabic-reshaper>=2.1.0
  Downloading arabic_reshaper-2.1.3-py3-none-any.whl (20 kB)
Collecting Pillow>=8.1.1
  Using cached Pillow-9.1.1-cp38-cp38-musllinux_1_1_x86_64.whl (3.2 MB)
Collecting PyPDF3>=1.0.5
  Downloading PyPDF3-1.0.6.tar.gz (294 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294.8/294.8 kB 1.9 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting python-bidi>=0.4.2
  Using cached python_bidi-0.4.2-py2.py3-none-any.whl (30 kB)
Collecting reportlab>=3.5.53
  Using cached reportlab-3.6.10.tar.gz (4.5 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      ##### setup-python-3.8.8-linux-x86_64: ================================================
      ##### setup-python-3.8.8-linux-x86_64: Attempting build of _rl_accel
      ##### setup-python-3.8.8-linux-x86_64: extensions from 'src/rl_addons/rl_accel'
      ##### setup-python-3.8.8-linux-x86_64: ================================================
      ##### setup-python-3.8.8-linux-x86_64: ===================================================
      ##### setup-python-3.8.8-linux-x86_64: Attempting build of _renderPM
      ##### setup-python-3.8.8-linux-x86_64: extensions from 'src/rl_addons/renderPM'
      ##### setup-python-3.8.8-linux-x86_64: ===================================================
      ##### setup-python-3.8.8-linux-x86_64: will use package libart 2.3.21
      !!!!! cannot find ft2build.h
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Добавление freetype-dev в ваш Dockerfile решит эту проблему, например:

RUN apk update \
    && apk add postgresql-dev gcc python3-dev musl-dev freetype-dev
Вернуться на верх