"Die Header-oder Bibliotheksdateien kann nicht gefunden werden für die jpeg -" installieren, Kissen auf Alpine Linux

Ich versuche zum ausführen von Python-Scrapy in einem Docker-container basiert auf python:alpine. Es war vor der Arbeit, aber jetzt würde ich gerne Scrapy ist Bild-Pipeline was muss ich installieren Kissen.

Als ein Vereinfachtes Beispiel, ich habe versucht, die folgenden Dockerfile:

FROM python:alpine
RUN apk --update add libxml2-dev libxslt-dev libffi-dev gcc musl-dev libgcc openssl-dev curl
RUN apk add libjpeg zlib tiff freetype lcms libwebp tcl openjpeg
RUN pip install Pillow

Jedoch, wenn ich versuche zu bauen, bekomme ich eine Fehlermeldung die Folgendes enthält:

Traceback (most recent call last):
  File "/tmp/pip-build-ft5yzzuv/Pillow/setup.py", line 744, in <module>
    zip_safe=not debug_build(), )
  File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/usr/local/lib/python3.6/distutils/command/install.py", line 545, in run
    self.run_command('build')
  File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/tmp/pip-build-ft5yzzuv/Pillow/setup.py", line 545, in build_extensions
    raise RequiredDependencyException(f)
__main__.RequiredDependencyException: jpeg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-ft5yzzuv/Pillow/setup.py", line 756, in <module>
    raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

Ging ich durch die Anforderungen an https://pillow.readthedocs.io/en/latest/installation.html und versuchte zu finden, die entsprechenden Pakete für Alpine, obwohl ich nicht finden konnte, war libimagequant, so könnte dies die 'Täter'. Dennoch, es wird die traceback-Fehlermeldung und Fehlermeldung zu sagen scheinen, dass jpeg fehlt, in der Erwägung, dass habe ich installiert openjpeg.

Wie kann ich ändern, das Dockerfile so dass pip install Pillow läuft?

InformationsquelleAutor Kurt Peek | 2017-05-18

Schreibe einen Kommentar