Running setup py install for pillow error

Recently, the pilot library will be used to train the verification code model, but it can’t be installed alive or dead

Foreword

Recently, the pilot library will be used to train the verification code model, but it can’t be installed alive or dead

Environment

Installed in docker, python3

Try to install

pip install pillow

easy_install Pillow

pipenv install pillow

As a result, life and death just can’t fit it

Errors are reported as follows:

Collecting pillow
  Using cached https://files.pythonhosted.org/packages/5b/bb/cdc8086db1f15d0664dd22a62c69613cdc00f1dd430b5b19df1bea83f2a3/Pillow-6.2.1.tar.gz
Building wheels for collected packages: pillow
  Building wheel for pillow (setup.py) ... error
  ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-heq42z9x --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  running egg_info
  writing src/Pillow.egg-info/PKG-INFO
  writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  writing top-level names to src/Pillow.egg-info/top_level.txt
  reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.codecov.yml'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'azure-pipelines.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.azure-pipelines'
  no previously-included directories found matching '.travis'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext
  
  
  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
  
  Traceback (most recent call last):
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
      zip_safe=not (debug_build() or PLATFORM_MINGW),
    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, 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-install-1vq2qpq_/pillow/setup.py", line 903, 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
  
  
  ----------------------------------------
  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow
  Running setup.py install for pillow ... error
    ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
    running egg_info
    writing src/Pillow.egg-info/PKG-INFO
    writing dependency_links to src/Pillow.egg-info/dependency_links.txt
    writing top-level names to src/Pillow.egg-info/top_level.txt
    reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    warning: no files found matching '*.sh'
    warning: no previously-included files found matching '.appveyor.yml'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.codecov.yml'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.readthedocs.yml'
    warning: no previously-included files found matching 'azure-pipelines.yml'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    no previously-included directories found matching '.azure-pipelines'
    no previously-included directories found matching '.travis'
    writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
    running build_ext
    
    
    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
    
    Traceback (most recent call last):
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
        zip_safe=not (debug_build() or PLATFORM_MINGW),
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.7/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, 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-install-1vq2qpq_/pillow/setup.py", line 903, 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
    
    
    ----------------------------------------
ERROR: Command "/usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-1vq2qpq_/pillow/

Solving

I searched hard on the Internet and finally found the answer in stack overflow. It turned out that there was a lack of dependency package

https://stackoverflow.com/questions/44043906/the-headers-or-library-files-could-not-be-found-for-jpeg-installing-pillow-on/44044479#44044479

Solution

In build   Add the following contents to the dockerfile file:

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

So you can build successfully

You can enter the container

Install these dependencies directly, and then you can install them directly in the container without rebuilding the image

apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev

Supplement

Well, you can use it happily. Others may be permission errors, or switch to the installation source

Содержание

  1. pip install Pillow failure #3077
  2. Comments
  3. What did you do?
  4. What did you expect to happen?
  5. What actually happened?
  6. What versions of Pillow and Python are you using?
  7. Footer
  8. Failure of ‘pip install Pillow==7.0.0’ #4456
  9. Comments
  10. What did you do?
  11. What did you expect to happen?
  12. What actually happened?
  13. What are your OS, Python and Pillow versions?
  14. When I try to pip install pillow, I get an error: ‘JPEG_LIB_VERSION’ undeclared #9
  15. Comments
  16. Issues with setup.py install for Pillow on Windows #3329
  17. Comments
  18. What did you do?
  19. What did you expect to happen?
  20. What actually happened?
  21. What versions of Pillow and Python are you using?
  22. «pip install pillow» failing with python 3.8 and pillow 6.2.1 #4158
  23. Comments

pip install Pillow failure #3077

What did you do?

pip install Pillow

What did you expect to happen?

Installation is success.

What actually happened?

Not install successfully.
I need other dependency lib?

What versions of Pillow and Python are you using?

The text was updated successfully, but these errors were encountered:

@ky0ncheng Can you please paste the entire output of pip install Pillow ? Everything after «Cleaning up» is not particularly helpful … unless it got installed and Cleaning up failed. shrug

Hi. Could also mention what operating system you are using? And, just to be interesting, could you try importing Pillow anyway? If pip has just hit an error on the cleanup, it seems conceivable to me that Pillow might actually be usable.

Hi. Depending on your OS, if you have anaconda installed, you should have pillow available in it or go to Pillow: Anaconda Cloud where you have the command to install pillow based on your OS.

If you don’t don’t have anaconda, I highly recommend you to install it. It makes your life easy.

If you don’t want to use anaconda, then another way you can try is to clone the github repository of Pillow by following:

If it is still not working it is better to paste your output of the pip installation as @aclark4life said the error that you are showing is not helpful to debug the error.

If it works, it is better to close the issue.

Hope this helps.

Closing due to lack of information.

I’m facing a similar issue with Pillow , here’s the output of trying to install it alone:

Never mind, it looks like it’s zlib dependency issue.

Everyone, thank you.

I think entware increase this problem.

This problem has been solved.

Installing all dependencies for building source solved it for me.
: sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev
libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev
tcl8.6-dev tk8.6-dev python-tk
https://pillow.readthedocs.io/en/latest/installation.html

I think entware increase this problem.

This problem has been solved.

how did you solve this problem?

apt-get install libjpeg-dev zlib1g-dev
pip3 install Pillow

For docker environment, got the issue resolved by installing
apk add zlib libjpeg-turbo-dev libpng-dev
freetype-dev lcms2-dev libwebp-dev
harfbuzz-dev fribidi-dev tcl-dev tk-dev

On Debian buster I install only the libjpeg62-turbo-dev

For docker environment, got the issue resolved by installing
apk add zlib libjpeg-turbo-dev libpng-dev
freetype-dev lcms2-dev libwebp-dev
harfbuzz-dev fribidi-dev tcl-dev tk-dev

I’m facing a similar issue with Pillow , here’s the output of trying to install it alone:

I am facing the same issue. what to do?

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

Or create a new issue with more details.

@hugovk Another candidate for locking? 😄

Also just want to cross-reference my last encounter, for posterity: #4242 (comment)

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Failure of ‘pip install Pillow==7.0.0’ #4456

What did you do?

I executed ‘pip install Pillow==7.0.0’ in the built-in terminal of my PyCharm Professional Project.

What did you expect to happen?

The installation of Pillow should be successful.

What actually happened?

Instead, it threw me an error that the required dependency ‘zlib’ is missing.

What are your OS, Python and Pillow versions?

  • OS: Windows 10 Home
  • Python: 3.8.2
  • Pillow: 7.0.0

The text was updated successfully, but these errors were encountered:

In addition I have also tried to use the ‘—disable-zlib’ flag to disable, however that threw me an error that the option ‘—disable-zlib’ is not recognised.

Why was this closed? I’m running into the same issue.

OK, found it. for some reason (https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000530279-unable-to-upgrade-the-pip-version-) the pip command that IntelliJ calls uses an older pip. Had to open terminal and issue instead:

Now it found the binaries, and didn’t try to compile.

I tried the -python pip install Pillow and pillow still does not load. my pip is 19.0.3-py3.8.egg in venv/lib

@Don-Odom Please could you open a new issue with more details?

Sorry. I am new to python. I am learning by trying to create a game. The game will require reading a jpg and inserting it into an excel spreadsheet. needing to read an image I tried ‘PIL import Image’,
but got

Источник

When I try to pip install pillow, I get an error: ‘JPEG_LIB_VERSION’ undeclared #9

gcc -pthread -fno-strict-aliasing -fPIC -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/include/freetype2 -IlibImaging -I/opt/ActivePython-2.7/include -I/usr/include/tcl8.5 -I/usr/local/include -I/usr/include -I/opt/ActivePython-2.7/include/python2.7 -I/usr/include/x86_64-linux-gnu -c libImaging/JpegDecode.c -o build/temp.linux-x86_64-2.7/libImaging/JpegDecode.o

libImaging/JpegDecode.c: In function ‘ImagingJpegDecode’:

libImaging/JpegDecode.c:136:2: error: ‘JPEG_LIB_VERSION’ undeclared (first use in this function)

libImaging/JpegDecode.c:136:2: note: each undeclared identifier is reported only once for each function it appears in

error: command ‘gcc’ failed with exit status 1

Command /opt/ActivePython-2.7/bin/python -c «import setuptools;file=’/app/build/pillow/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /tmp/pip-AcU1C_-record/install-record.txt failed with error code 1 in /app/build/pillow
Storing complete log in /app/.pip/pip.log

All the pillow dependencies are install using apt-get:

The text was updated successfully, but these errors were encountered:

This is on Ubuntu 12.04.

On Wed, Aug 29, 2012 at 7:38 PM, Alex Clark ☺ notifications@github.comwrote:


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-8145016.

/Developer/venv/ > cat /etc/issue Ubuntu 12.04.1 LTS n l «>

Wait, I don’t have libjpeg

OK, now works for me with libjpeg-dev and friends installed:

Источник

Issues with setup.py install for Pillow on Windows #3329

What did you do?

Run setup.py install for Pillow

What did you expect to happen?

What actually happened?

Running setup.py install for Pillow . error

c:usersstefaappdatalocalprogramspythonpython36includepyconfig.h(59): fatal error C1083: Cannot open include file: ‘io.h’: No such file or directory error: command ‘F:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX86\x64\cl.exe’ failed with exit status 2 Rolling back uninstall of pillow Command «c:usersstefaappdatalocalprogramspythonpython36python.exe -u -c «import setuptools, tokenize;__file__=’C:\Users\stefa\AppData\Local\Temp\pip-install-o_u09_8s\Pillow\setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))» install —record C:UsersstefaAppDataLocalTemppip-record-0qey88u5install-record.txt —single-version-externally-managed —compile» failed with error code 1 in C:UsersstefaAppDataLocalTemppip-install-o_u09_8sPillow

What versions of Pillow and Python are you using?

Latest versions of both

Please let me know if there’s any more information I can give, very new to this so not sure what is relevant. I assume the issue is caused by the missing file/directory, but no idea what to do with that information.

The text was updated successfully, but these errors were encountered:

Источник

«pip install pillow» failing with python 3.8 and pillow 6.2.1 #4158

I noticed that support for 3.8 has been added to pillow 6.2.1, but when I try to pip install it, it’s trying to build from source and errors because no zlib.

Am I just being too impatient and binary wheels are forthcoming?

Here’s my python runtime info:

Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32

The text was updated successfully, but these errors were encountered:

I am having the same issue on 64-bit
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32

@CRCGlobal for some reason yours is still trying to pull 6.2.0. Try clearing your pip cache and see if that fixes it to pull 6.2.1

I just realized that and I retried with the no-cache-dir option and have a new error

Filename, size File type Python version Upload date Hashes
Wheel cp27 about 2 hours ago View
Wheel cp27 about 2 hours ago View
Wheel cp27 about 2 hours ago View
Wheel cp27 about 2 hours ago View
Wheel cp27 about 2 hours ago View
Wheel cp27 about 2 hours ago View
Wheel cp27 about 2 hours ago View
Wheel cp35 about 2 hours ago View
Wheel cp35 about 2 hours ago View
Wheel cp35 about 2 hours ago View
Wheel cp35 about 2 hours ago View
Wheel cp35 about 2 hours ago View
Wheel cp36 about 2 hours ago View
Wheel cp36 about 2 hours ago View
Wheel cp36 about 2 hours ago View
Wheel cp36 about 2 hours ago View
Wheel cp36 about 2 hours ago View
Wheel cp37 about 2 hours ago View
Wheel cp37 about 2 hours ago View
Wheel cp37 about 2 hours ago View
Wheel cp37 about 2 hours ago View
Wheel cp37 about 2 hours ago View
Wheel cp38 about 2 hours ago View
Wheel cp38 about 2 hours ago View
Wheel cp38 about 2 hours ago View
Wheel pp272 about 2 hours ago View
Wheel pp372 about 2 hours ago View
Source None about 2 hours ago View

28 files locally:

@remdragon Please can you also paste the full pip install output?

Here’s my full pip output:

What pip versions do you have? Does upgrading help?

Источник

preface
We recently used the Pillow library to train the captcha model, but it won’t install either live or dead
The environment
Docker is installed in python3
Trying to install
pip install pillow
easy_install Pillow
pipenv install pillow
As a result, they just can’t fit
The error is as follows:

Collecting pillow
  Using cached https://files.pythonhosted.org/packages/5b/bb/cdc8086db1f15d0664dd22a62c69613cdc00f1dd430b5b19df1bea83f2a3/Pillow-6.2.1.tar.gz
Building wheels for collected packages: pillow
  Building wheel for pillow (setup.py) ... error
  ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-heq42z9x --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  running egg_info
  writing src/Pillow.egg-info/PKG-INFO
  writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  writing top-level names to src/Pillow.egg-info/top_level.txt
  reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.codecov.yml'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'azure-pipelines.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.azure-pipelines'
  no previously-included directories found matching '.travis'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext
  
  
  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
  
  Traceback (most recent call last):
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
      zip_safe=not (debug_build() or PLATFORM_MINGW),
    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, 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-install-1vq2qpq_/pillow/setup.py", line 903, 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
  
  
  ----------------------------------------
  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow
  Running setup.py install for pillow ... error
    ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
    running egg_info
    writing src/Pillow.egg-info/PKG-INFO
    writing dependency_links to src/Pillow.egg-info/dependency_links.txt
    writing top-level names to src/Pillow.egg-info/top_level.txt
    reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    warning: no files found matching '*.sh'
    warning: no previously-included files found matching '.appveyor.yml'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.codecov.yml'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.readthedocs.yml'
    warning: no previously-included files found matching 'azure-pipelines.yml'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    no previously-included directories found matching '.azure-pipelines'
    no previously-included directories found matching '.travis'
    writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
    running build_ext
    
    
    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
    
    Traceback (most recent call last):
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
        zip_safe=not (debug_build() or PLATFORM_MINGW),
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.7/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, 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-install-1vq2qpq_/pillow/setup.py", line 903, 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
    
    
    ----------------------------------------
ERROR: Command "/usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-1vq2qpq_/pillow/
 

To solve the…
After searching on the Internet, I finally found the answer on StackOverflow. It turned out to be the lack of dependency packets
https://stackoverflow.com/questions/44043906/the-headers-or-library-files-could-not-be-found-for-jpeg-installing-pillow-on/44044479#44044479

 
The solution
Add the following to the build Dockerfile:

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

This will allow you to build successfully

 
You can go into the container
Install these dependencies directly, and you can install them directly in the container without having to rebuild the image

apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev

supplement
Good, you can happily use, other may be the permission error, or switch under the installation source

(cuckoo) albert@zhuang-pc:~$ pip install cuckoo

Collecting cuckoo

Requirement already satisfied: unicorn==1.0.1 in ./miniconda2/envs/cuckoo/lib/python2.7/site-packages (from cuckoo)

Requirement already satisfied: alembic==0.8.8 in ./miniconda2/envs/cuckoo/lib/python2.7/site-packages (from cuckoo)

Requirement already satisfied: wakeonlan==0.2.2 in ./miniconda2/envs/cuckoo/lib/python2.7/site-packages (from cuckoo)

Collecting sflock<0.3,>=0.2.15 (from cuckoo)

# ...

Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=1.3.4; extra == "security"->requests[security]==2.13.0; sys_platform == "linux2"->cuckoo)

Building wheels for collected packages: pillow

Running setup.py bdist_wheel for pillow ... error

Complete output from command /home/albert/miniconda2/envs/cuckoo/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s5clPe/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpN75cBapip-wheel- --python-tag cp27:

running bdist_wheel

running build

running build_py

creating build

# ...

building 'PIL._imagingtk' extension

creating build/temp.linux-x86_64-2.7/Tk

Building using 4 processes

gcc -pthread -B /home/albert/miniconda2/envs/cuckoo/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-s5clPe/pillow/libImaging -I/home/albert/miniconda2/envs/cuckoo/include -I/usr/local/include -I/usr/include -I/home/albert/miniconda2/envs/cuckoo/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imagingtk.c -o build/temp.linux-x86_64-2.7/_imagingtk.o

gcc -pthread -B /home/albert/miniconda2/envs/cuckoo/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-s5clPe/pillow/libImaging -I/home/albert/miniconda2/envs/cuckoo/include -I/usr/local/include -I/usr/include -I/home/albert/miniconda2/envs/cuckoo/include/python2.7 -I/usr/include/x86_64-linux-gnu -c Tk/tkImaging.c -o build/temp.linux-x86_64-2.7/Tk/tkImaging.o

In file included from Tk/tkImaging.c:52:0:

/home/albert/miniconda2/envs/cuckoo/include/tk.h:96:25: fatal error: X11/Xlib.h: No such file or directory

compilation terminated.

In file included from _imagingtk.c:19:0:

/home/albert/miniconda2/envs/cuckoo/include/tk.h:96:25: fatal error: X11/Xlib.h: No such file or directory

compilation terminated.

gcc -pthread -shared -B /home/albert/miniconda2/envs/cuckoo/compiler_compat -L/home/albert/miniconda2/envs/cuckoo/lib -Wl,-rpath=/home/albert/miniconda2/envs/cuckoo/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-2.7/_imagingtk.o build/temp.linux-x86_64-2.7/Tk/tkImaging.o -L/home/albert/miniconda2/envs/cuckoo/lib -L/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L/usr/lib -L/home/albert/miniconda2/envs/cuckoo/lib -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ltk8.6 -lpython2.7 -o build/lib.linux-x86_64-2.7/PIL/_imagingtk.so

gcc: error: build/temp.linux-x86_64-2.7/_imagingtk.o: No such file or directory

gcc: error: build/temp.linux-x86_64-2.7/Tk/tkImaging.o: No such file or directory

error: command 'gcc' failed with exit status 1

----------------------------------------

Failed building wheel for pillow

Running setup.py clean for pillow

Failed to build pillow

Installing collected packages: pillow, peepdf, olefile, python-magic, sflock, scapy, pymongo, idna, pycparser, cffi, enum34, asn1crypto, ipaddress, cryptography, pyOpenSSL, requests, pyelftools, yara-python, python-dateutil, functools32, jsonschema, pymisp, pefile2, cuckoo

Found existing installation: Pillow 4.3.0

Uninstalling Pillow-4.3.0:

Successfully uninstalled Pillow-4.3.0

Running setup.py install for pillow ... error

Complete output from command /home/albert/miniconda2/envs/cuckoo/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s5clPe/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-i1e7bP-record/install-record.txt --single-version-externally-managed --compile:

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

# ...

building 'PIL._imagingtk' extension

creating build/temp.linux-x86_64-2.7/Tk

Building using 4 processes

gcc -pthread -B /home/albert/miniconda2/envs/cuckoo/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-s5clPe/pillow/libImaging -I/home/albert/miniconda2/envs/cuckoo/include -I/usr/local/include -I/usr/include -I/home/albert/miniconda2/envs/cuckoo/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imagingtk.c -o build/temp.linux-x86_64-2.7/_imagingtk.o

gcc -pthread -B /home/albert/miniconda2/envs/cuckoo/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-s5clPe/pillow/libImaging -I/home/albert/miniconda2/envs/cuckoo/include -I/usr/local/include -I/usr/include -I/home/albert/miniconda2/envs/cuckoo/include/python2.7 -I/usr/include/x86_64-linux-gnu -c Tk/tkImaging.c -o build/temp.linux-x86_64-2.7/Tk/tkImaging.o

In file included from Tk/tkImaging.c:52:0:

/home/albert/miniconda2/envs/cuckoo/include/tk.h:96:25: fatal error: X11/Xlib.h: No such file or directory

compilation terminated.

In file included from _imagingtk.c:19:0:

/home/albert/miniconda2/envs/cuckoo/include/tk.h:96:25: fatal error: X11/Xlib.h: No such file or directory

compilation terminated.

gcc -pthread -shared -B /home/albert/miniconda2/envs/cuckoo/compiler_compat -L/home/albert/miniconda2/envs/cuckoo/lib -Wl,-rpath=/home/albert/miniconda2/envs/cuckoo/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-2.7/_imagingtk.o build/temp.linux-x86_64-2.7/Tk/tkImaging.o -L/home/albert/miniconda2/envs/cuckoo/lib -L/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L/usr/lib -L/home/albert/miniconda2/envs/cuckoo/lib -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ltk8.6 -lpython2.7 -o build/lib.linux-x86_64-2.7/PIL/_imagingtk.so

gcc: error: build/temp.linux-x86_64-2.7/_imagingtk.o: No such file or directory

gcc: error: build/temp.linux-x86_64-2.7/Tk/tkImaging.o: No such file or directory

error: command 'gcc' failed with exit status 1

----------------------------------------

Rolling back uninstall of Pillow

Command "/home/albert/miniconda2/envs/cuckoo/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s5clPe/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-i1e7bP-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-s5clPe/pillow/

I ran into a bit of an issue trying to install Pillow on Raspbian with Python 3.5.2. The full error is below, but the solution was simply to install the following:

sudo pip3.5 install pillow
Collecting pillow
Using cached Pillow-4.3.0.tar.gz
Requirement already satisfied: olefile in /usr/local/lib/python3.5/site-packages (from pillow)
Installing collected packages: pillow
Running setup.py install for pillow … error
Complete output from command /usr/local/bin/python3.5 -u -c “import setuptools, tokenize;__file__=’/tmp/pip-build-inj0l_9q/pillow/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))” install –record /tmp/pip-xp_x4w_5-record/install-record.txt –single-version-externally-managed –compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/PIL
copying PIL/MicImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageMath.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/WebPImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImagePath.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageGrab.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/SunImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/__init__.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageEnhance.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageMorph.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/XpmImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/EpsImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/FtexImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/WmfImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/FitsStubImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageDraw2.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/IptcImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/_binary.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/MpoImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/Image.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/MspImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageWin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/GimpPaletteFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageTk.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PSDraw.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/McIdasImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/SgiImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageStat.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageChops.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PdfImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/features.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PcfFontFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PcxImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageOps.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImagePalette.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/TgaImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageSequence.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/_util.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/TiffTags.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/BmpImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/DdsImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ExifTags.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PyAccess.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PpmImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageCms.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PaletteFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/XVThumbImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/IcoImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageFilter.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageFont.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/GifImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/GbrImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/XbmImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PngImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/FontFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/IcnsImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/TiffImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/_tkinter_finder.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/DcxImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/OleFileIO.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/SpiderImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/JpegImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/GribStubImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/MpegImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PalmImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/BdfFontFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/GimpGradientFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PsdImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/WalImageFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PcdImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/version.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/FpxImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageQt.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageDraw.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/GdImageFile.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ContainerIO.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/CurImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/FliImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageMode.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/JpegPresets.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/PixarImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageColor.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/BufrStubImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageTransform.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImageShow.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/TarIO.py -> build/lib.linux-armv7l-3.5/PIL
copying PIL/ImtImagePlugin.py -> build/lib.linux-armv7l-3.5/PIL
running egg_info
writing dependency_links to Pillow.egg-info/dependency_links.txt
writing requirements to Pillow.egg-info/requires.txt
writing top-level names to Pillow.egg-info/top_level.txt
writing Pillow.egg-info/PKG-INFO
warning: manifest_maker: standard file ‘-c’ not found

reading manifest file ‘Pillow.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘*.sh’
no previously-included directories found matching ‘docs/_static’
warning: no previously-included files found matching ‘.coveragerc’
warning: no previously-included files found matching ‘codecov.yml’
warning: no previously-included files found matching ‘.editorconfig’
warning: no previously-included files found matching ‘.landscape.yaml’
warning: no previously-included files found matching ‘.travis’
warning: no previously-included files found matching ‘.travis/*’
warning: no previously-included files found matching ‘appveyor.yml’
warning: no previously-included files found matching ‘build_children.sh’
warning: no previously-included files found matching ‘tox.ini’
warning: no previously-included files matching ‘.git*’ found anywhere in distribution
warning: no previously-included files matching ‘*.pyc’ found anywhere in distribution
warning: no previously-included files matching ‘*.so’ found anywhere in distribution
writing manifest file ‘Pillow.egg-info/SOURCES.txt’
running build_ext

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

Traceback (most recent call last):
File “/tmp/pip-build-inj0l_9q/pillow/setup.py”, line 787, in
zip_safe=not (debug_build() or PLATFORM_MINGW), )
File “/usr/local/lib/python3.5/distutils/core.py”, line 148, in setup
dist.run_commands()
File “/usr/local/lib/python3.5/distutils/dist.py”, line 955, in run_commands
self.run_command(cmd)
File “/usr/local/lib/python3.5/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/usr/local/lib/python3.5/site-packages/setuptools/command/install.py”, line 61, in run
return orig.install.run(self)
File “/usr/local/lib/python3.5/distutils/command/install.py”, line 539, in run
self.run_command(‘build’)
File “/usr/local/lib/python3.5/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/usr/local/lib/python3.5/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/usr/local/lib/python3.5/distutils/command/build.py”, line 135, in run
self.run_command(cmd_name)
File “/usr/local/lib/python3.5/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/usr/local/lib/python3.5/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/usr/local/lib/python3.5/distutils/command/build_ext.py”, line 338, in run
self.build_extensions()
File “/tmp/pip-build-inj0l_9q/pillow/setup.py”, line 577, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: jpeg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-inj0l_9q/pillow/setup.py”, line 799, in
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

—————————————-
Command “/usr/local/bin/python3.5 -u -c “import setuptools, tokenize;__file__=’/tmp/pip-build-inj0l_9q/pillow/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))” install –record /tmp/pip-xp_x4w_5-record/install-record.txt –single-version-externally-managed –compile” failed with error code 1 in /tmp/pip-build-inj0l_9q/pillow/

Problem:

When trying to install pillow such as using

pip install Pillow

you see an error log like

      running build_ext
      
      
      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
      
      Traceback (most recent call last):
        File "/tmp/pip-install-_g5fa7ox/pillow_7cb18c0d6bec468e8844184b98c8bf45/setup.py", line 989, in <module>
          setup(
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/command/install.py", line 68, in run
          return orig.install.run(self)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/command/install.py", line 670, in run
          self.run_command('build')
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/command/build.py", line 136, in run
          self.run_command(cmd_name)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/dist.py", line 1214, in run_command
          super().run_command(command)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/command/build_ext.py", line 79, in run
          _build_ext.run(self)
        File "/home/uli/.pypy3-virtualenv/lib/pypy3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run
          self.build_extensions()
        File "/tmp/pip-install-_g5fa7ox/pillow_7cb18c0d6bec468e8844184b98c8bf45/setup.py", line 804, in build_extensions
          raise RequiredDependencyException(f)
      RequiredDependencyException: jpeg
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-_g5fa7ox/pillow_7cb18c0d6bec468e8844184b98c8bf45/setup.py", line 1009, in <module>
          raise RequiredDependencyException(msg)
      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
      
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> Pillow

Solution:

Pillow needs a buch of libraries to be installed in order to work properly. Use the following command from the official Pillow website on Ubuntu:

sudo apt-get install cmake libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev

or check out the installation guide for commands for other operating systems.

Понравилась статья? Поделить с друзьями:
  • Running setup py install for mysqlclient error
  • Running setup py install for qdldl error
  • Run time error 19 file or function is not found как исправить samp
  • Running setup py install for lxml finished with status error
  • Running setup py install for pycrypto error