Giter Site home page Giter Site logo

uploadcare / pillow-simd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from python-pillow/pillow

2.1K 41.0 85.0 86.08 MB

The friendly PIL fork

Home Page: https://python-pillow.github.io/pillow-perf/

License: Other

Makefile 0.12% Python 57.99% Shell 0.23% Gnuplot 0.04% C 40.61% HTML 0.53% PostScript 0.38% CMake 0.11%

pillow-simd's Introduction

Pillow-SIMD

Pillow-SIMD is highly optimized version of Pillow library for x86 architecture (mainly Intel and AMD CPUs).

Pillow-SIMD is "following" Pillow which means it is drop-in replacements for Pillow of the same version. For example, Pillow-SIMD 3.2.0.post3 is a drop-in replacement for Pillow 3.2.0, and Pillow-SIMD 3.3.3.post0 — for Pillow 3.3.3.

For more information on the original Pillow, please refer to: read the documentation, check the changelog and find out how to contribute.

Why SIMD

There are multiple ways to tweak image processing performance. To name a few, such ways can be: utilizing better algorithms, optimizing existing implementations, using more processing power and/or resources. One of the great examples of using a more efficient algorithm is replacing a convolution-based Gaussian blur with a sequential-box one.

Such examples are rather rare, though. It is also known, that certain processes might be optimized by using parallel processing to run the respective routines. But a more practical key to optimizations might be making things work faster using the resources at hand. For instance, SIMD computing might be the case.

SIMD stands for "single instruction, multiple data" and its essence is in performing the same operation on multiple data points simultaneously by using multiple processing elements. Common CPU SIMD instruction sets are MMX, SSE-SSE4, AVX, AVX2, AVX512, NEON.

Currently, Pillow-SIMD can be compiled with SSE4 (default) or AVX2 support.

Status

Pillow-SIMD project is production-ready. The project is supported by Uploadcare, a SAAS for cloud-based image storing and processing.

Uploadcare

In fact, Uploadcare has been running Pillow-SIMD since 2015.

The following image operations are currently SIMD-accelerated:

  • Resize (convolution-based resampling): SSE4, AVX2
  • Gaussian and box blur: SSE4
  • Alpha composition: SSE4, AVX2
  • RGBA → RGBa (alpha premultiplication): SSE4, AVX2
  • RGBa → RGBA (division by alpha): SSE4, AVX2
  • RGB → L (grayscale): SSE4
  • 3x3 and 5x5 kernel filters: SSE4, AVX2
  • Split and get_channel: SSE4

Benchmarks

Tons of tests can be found on the Pillow Performance page. There are benchmarks against different versions of Pillow and Pillow-SIMD as well as ImageMagick, Skia, OpenCV and IPP.

The results show that for resizing Pillow is always faster than ImageMagick, Pillow-SIMD, in turn, is even faster than the original Pillow by the factor of 4-6. In general, Pillow-SIMD with AVX2 is always 16 to 40 times faster than ImageMagick and outperforms Skia, the high-speed graphics library used in Chromium.

Why Pillow itself is so fast

No cheats involved. We've used identical high-quality resize and blur methods for the benchmark. Outcomes produced by different libraries are in almost pixel-perfect agreement. The difference in measured rates is only provided with the performance of every involved algorithm.

Why Pillow-SIMD is even faster

Because of the SIMD computing, of course. But there's more to it: heavy loops unrolling, specific instructions, which aren't available for scalar data types.

Why do not contribute SIMD to the original Pillow

Well, it's not that simple. First of all, the original Pillow supports a large number of architectures, not just x86. But even for x86 platforms, Pillow is often distributed via precompiled binaries. In order for us to integrate SIMD into the precompiled binaries we'd need to execute runtime CPU capabilities checks. To compile the code this way we need to pass the -mavx2 option to the compiler. But with the option included, a compiler will inject AVX instructions even for SSE functions (i.e. interchange them) since every SSE instruction has its AVX equivalent. So there is no easy way to compile such library, especially with setuptools.

Installation

If there's a copy of the original Pillow installed, it has to be removed first with $ pip uninstall -y pillow. Please install prerequisites for your platform. The installation itself is simple just as running $ pip install pillow-simd, and if you're using SSE4-capable CPU everything should run smoothly. If you'd like to install the AVX2-enabled version, you need to pass the additional flag to a C compiler. The easiest way to do so is to define the CC variable during the compilation.

$ pip uninstall pillow
$ CC="cc -mavx2" pip install -U --force-reinstall pillow-simd

Contributing to Pillow-SIMD

Please be aware that Pillow-SIMD and Pillow are two separate projects. Please submit bugs and improvements not related to SIMD to the original Pillow. All bugfixes to the original Pillow will then be transferred to the next Pillow-SIMD version automatically.

pillow-simd's People

Contributors

aclark4life avatar al45tair avatar anntzer avatar artscoop avatar cgohlke avatar d-schmidt avatar elejke avatar fahad-alsaidi avatar feneric avatar homm avatar hugovk avatar irskep avatar jbltx avatar jd20 avatar jdufresne avatar joshware avatar kkopachev avatar manisandro avatar mergify[bot] avatar nulano avatar olt avatar pmrowla avatar radarhere avatar rr- avatar sircinnamon avatar terseus avatar urielmad avatar vashek avatar wiredfool avatar xtsm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pillow-simd's Issues

thumbnail just quits

What did you do?

C:\Users\ingo\Documents\Python\PostCamera\static\img\archive>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>> PIL.__version__
'6.0.0.post0'
>>> from PIL import Image
>>> image = Image.open('a.jpg')
>>> image.thumbnail((100,100))

C:\Users\ingo\Documents\Python\PostCamera\static\img\archive>

EDIT: actually applying any form of filter to scale has the same result
image.scale((100,100), Image.SomeFilterHere)

What actually happened?

After using image.thumbnail python just quits.

What are your OS, Python and Pillow versions?

  • OS: win10
  • Python: 3.7
  • Pillow: 6 (Gohlke compile)

Pillow-simd as a C shared library

What did you do?

I have read C source

What did you expect to happen?

Boom! And all over the world are happy!

What actually happened?

Boom failed.

Can you please provide some tools / instructions / documentation for extracting pillow-simd as a C shared library? I think it's a good goal to bring this blazing-fast image tool to JVM world.

Segfault in .thumbnail()

What did you do?

Image.thumbnail()

What did you expect to happen?

Resize the image

What actually happened?

Segfault

What are your OS, Python and Pillow versions?

  • CPU: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
  • OS: Linux 4.14.78-gentoo #⁠1 SMP x86_64 Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz GenuineIntel GNU/Linux
  • Python: 3.6.5
  • Pillow: 5.3.0.post1

Works with standard Pillow or on other CPUs, e.g. E5506.

#!/usr/bin/python3
# -*- coding: UTF-8 -*-#

import os, argparse
from PIL import Image


def make_thumb(base_dir, full_file_name, width):

    file_name, file_extension = os.path.splitext(full_file_name)
    size = width, width

    if os.path.exists(base_dir + full_file_name):
        nImage = Image.open(base_dir + full_file_name)
        nImage.thumbnail(size, Image.ANTIALIAS)

        nFileName = str(base_dir) + str(file_name) + "_" + str(width) + str(file_extension)
        nImage.save(nFileName)

    else:
        print("file does not exists")


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='generate a thumbnail from given picture, if it exists')
    parser.add_argument('-f', action="store", dest="file", type=str, required=True, help="")
    parser.add_argument('-w', action="store", dest="width", type=int, required=True, help="")
    parser.add_argument('-b', action="store", dest="base_dir", type=str, default="/www/test", required=False)
    args = parser.parse_args()
    make_thumb(args.base_dir, args.file, args.width)

libjpeg.so.8 not found when using with AWS Lambda

What did you do?

I'm trying to use pillow-simd (instead of pillow) with an AWS Lambda function.

What did you expect to happen?

It works, as pillow does

What actually happened?

I'm getting the following error message:

Unable to import module 'app': libjpeg.so.8: cannot open shared object file: No such file or directory

Please note that the standard pillow library (5.1.0) works properly.

What versions of Pillow and Python are you using?

Python 3.6.5
Pillow-SIMD 5.1.1.post0

AH01215: ImportError: No module named PIL: - python script unable to recognize PIL when running from apache2 config

What did you do?

I have configured in apache httpd.conf - enabling of mod_cgi.so and httpd-vhosts.conf.

In httpd-vhosts have following conifguration. Basically am trying to capture all /images/ pattern, read have that process using a index.py script and return back as image/jpeg content.

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.groc-example.com
ServerAlias groc-example.com
Alias "/images/" "/var/www/images/"
DirectoryIndex index.py
ErrorLog "/private/var/log/apache2/groc-example-images-error_log"
CustomLog "/private/var/log/apache2/groc-access-log" common
<Directory "/var/www/images/">
Options +ExecCGI
Allow from all
Require all granted
ForceType text/html
AddHandler cgi-script .py

In the index.py am just trying to start the script by trying to import the image. It doenst work i.e. recognize at all. The same import of PIL works from python2/python3 interface in spyder or pycharm or commandlines.

If I remove PIL import statement, the html works or prints out to browser.

#! /usr/bin/env python
from PIL import Image

print ""
print "hello world"
print "--"
print ""

What did you expect to happen?

python script to recognize PIL but it doesnt recognize. I have uninstalled PIL-SIMD multiple times and reinstalled but it isnt working.
Though I have both python2 and python3, default am using python2 and so is apache CGI interface.

What actually happened?

I capture following error in apache logs.
AH01215: from PIL import Image: /var/www/images/index.py
AH01215: ImportError: No module named PIL: /var/www/images/index.py

What versions of Pillow and Python are you using?

Python 2.7.12
Pillow-SIMD
Pillow-SIMD (4.0.0.post0)

Please help if this wont resolve, I have to completely move away from python.

save_all from GIF to

What did you do?

What did you expect to happen?

What actually happened?

What versions of Pillow and Python are you using?

Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.

The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.

code goes here

request: Pillow-simd w/ libjpeg-turbo conda/pip package

Since you have been making this amazing effort to port more and more things into SIMD, I was wondering if perhaps you have a modified conda recipe that builds Pillow-simd w/ built-in libjpeg-turbo library.

Currently, Pillow-simd is already a problem with conda, since any update of any package relying on Pillow will wipe out Pillow-simd. And if one wants to build either Pillow or Pillow-SIMD with libjpeg-turbo to include SIMD compression/decompression it becomes even more complicated package management-wise. Plus there is a potential conflict of libjpeg-turbo and jpeg should they both have the same libjpeg.so.x.y - that would be the worst!

I spent the last few days trying to sort it out, resulting in this documentation https://docs.fast.ai/performance.html#faster-image-processing and python-pillow#3493 kindly contributed by @radarhere, which I hope you will sync into your branch soon. The main effort was made to detect the SIMD versions of Pillow and libjpeg because they are so volatile in the pypi/conda environments.

We really need a reliable binary package that has all the SIMD goodness and which won't get swapped out and replaced by the default-limited versions of the same. And so that other packages (fastai in our case) could depend on it in their pypi/conda dependencies.

I propose a new version of pillow-simd called pillow-simd-jpeg-turbo which will be a binary build of Pillow-SIMD, built with libjpeg-turbo's libjpeg.so at a unique location under PIL/, rather than environment's libs, so that one doesn't need to install the turbo package (and no need for any other files from the libjpeg-turbo package). And once installed it'll reliable work, no matter what other packages get installed or updated.

And for our use, linux-only build would be a great start.

Thoughts?

edit: re-reading again your README file, I now see that pre-compiling won't work. What about making a source pip package then that will be compiled by each user, but once compiled it'll be left alone and not swapped out by conda/pip updates of other packages.

and moreover my idea won't work unless it'll replace PIL with PIL-foo, so it's no longer a drop-in replacement, but a different namespace altogether. Which perhaps could be aliased back to PIL, and it'd go something like:

try:
    import PIL_SIMD
    PIL = PIL_SIMD # alias to PIL
    ...etc...
except:
    import PIL

What a mess.

Finally, libjpeg-turbo is distributed as a binary, and it says AVX2 is supported. Sorry, I am new to SIMD, you say Pillow-SIMD has to be built from source, but libjpeg-turbo doesn't? Please kindly explain.

Segmentation fault (core dumped)

What did you do?

run pillow-simd in python:alpine docker

What did you expect to happen?

work

What actually happened?

Segmentation fault (core dumped)

What are your OS, Python and Pillow versions?

dockerfile

FROM python:3.7-alpine
RUN apk add --no-cache gcc g++ make zlib-dev libjpeg-turbo-dev libwebp-dev freetype-dev
RUN pip3 install pillow-simd qrcode
Step 1/3 : FROM python:3.7-alpine
3.7-alpine: Pulling from library/python
e6b0cf9c0882: Already exists 
da0e9bf0cc60: Already exists 
b9340422295e: Pull complete 
3c651fc490ae: Pull complete 
aa5f53becb54: Pull complete 
Digest: sha256:860856fce0f6f17e48b1a9ca89ec8ac99293af6bbc73e4e46a1ebce86daf122b
Status: Downloaded newer image for python:3.7-alpine
 ---> 16a54299f91e
Step 2/3 : RUN apk add --no-cache gcc g++ make zlib-dev libjpeg-turbo-dev libwebp-dev freetype-dev
 ---> Running in e050e384c9f3
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/24) Installing libpng (1.6.37-r1)
(2/24) Installing freetype (2.10.1-r0)
(3/24) Installing pkgconf (1.6.3-r0)
(4/24) Installing zlib-dev (1.2.11-r3)
(5/24) Installing libpng-dev (1.6.37-r1)
(6/24) Installing freetype-dev (2.10.1-r0)
(7/24) Installing libgcc (9.2.0-r3)
(8/24) Installing libstdc++ (9.2.0-r3)
(9/24) Installing binutils (2.33.1-r0)
(10/24) Installing gmp (6.1.2-r1)
(11/24) Installing isl (0.18-r0)
(12/24) Installing libgomp (9.2.0-r3)
(13/24) Installing libatomic (9.2.0-r3)
(14/24) Installing mpfr4 (4.0.2-r1)
(15/24) Installing mpc1 (1.1.0-r1)
(16/24) Installing gcc (9.2.0-r3)
(17/24) Installing musl-dev (1.1.24-r0)
(18/24) Installing libc-dev (0.7.2-r0)
(19/24) Installing g++ (9.2.0-r3)
(20/24) Installing libjpeg-turbo (2.0.4-r0)
(21/24) Installing libjpeg-turbo-dev (2.0.4-r0)
(22/24) Installing libwebp (1.0.3-r0)
(23/24) Installing libwebp-dev (1.0.3-r0)
(24/24) Installing make (4.2.1-r2)
Executing busybox-1.31.1-r8.trigger
OK: 188 MiB in 59 packages
Removing intermediate container e050e384c9f3
 ---> 3e48a674e3ca
Step 3/3 : RUN pip3 install pillow-simd qrcode
 ---> Running in 027e424160b5
Collecting pillow-simd
  Downloading https://files.pythonhosted.org/packages/b1/19/b7043190f481abb94dcdd1e69c4432432aaa73455cf1128eae39b8eb2518/Pillow-SIMD-6.0.0.post0.tar.gz (621kB)
Collecting qrcode
  Downloading https://files.pythonhosted.org/packages/42/87/4a3a77e59ab7493d64da1f69bf1c2e899a4cf81e51b2baa855e8cc8115be/qrcode-6.1-py2.py3-none-any.whl
Collecting six
  Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Building wheels for collected packages: pillow-simd
  Building wheel for pillow-simd (setup.py): started
  Building wheel for pillow-simd (setup.py): still running...
  Building wheel for pillow-simd (setup.py): finished with status 'done'
  Created wheel for pillow-simd: filename=Pillow_SIMD-6.0.0.post0-cp37-cp37m-linux_x86_64.whl size=1288604 sha256=6c0b5afa9f948a68e6ef409bebc122fc7383854fd5421c39c03b4e49e633f228
  Stored in directory: /root/.cache/pip/wheels/06/60/65/cc9afa345ccbf10a34cc208266b992941a8608010b592f43d1
Successfully built pillow-simd
Installing collected packages: pillow-simd, six, qrcode
Successfully installed pillow-simd-6.0.0.post0 qrcode-6.1 six-1.13.0
from PIL import Image, ImageFont, ImageDraw, ImageFilter, ExifTags

im = Image.open('assets/img/card/11.jpg') 

print(im.size)

box=(100,400)

im.thumbnail(box)

I tried python:alpine python:3.7-alpine

and CC="cc -mavx2" pip3 install -U --force-reinstall pillow-simd

both all Segmentation fault (core dumped)

Premultiplied alpha and integration with cairo ?

Does this use premultiplied alpha ?

I assume it might do, as this would make things efficient for SIMD.

I ask, as it is the native pixel format (BaGaRaA) for cairo, so it could make integration with that library efficient + straightforward.

TypeError: object of type 'NoneType' has no len()

TypeError: object of type 'NoneType' has no len()

This image has a value "comment" is None. It raises that error.

https://github.com/uploadcare/pillow-simd/blob/simd/5.1.x/src/PIL/GifImagePlugin.py#L527

    if "comment" in im.encoderinfo and 1 <= len(im.encoderinfo["comment"]) <= 255:
        fp.write(b"!" +
                 o8(254) +                # extension intro
                 o8(len(im.encoderinfo["comment"])) +
                 im.encoderinfo["comment"] +
                 o8(0))

https://github.com/uploadcare/pillow-simd/blob/simd/5.1.x/src/PIL/GifImagePlugin.py#L694

    for extensionKey in ["transparency", "duration", "loop", "comment"]:
        if info and extensionKey in info:
            if ((extensionKey == "duration" and info[extensionKey] == 0) or
               (extensionKey == "comment" and info[extensionKey] is not None and not (1 <= len(info[extensionKey]) <= 255))):
                continue
            version = b"89a"
            break
{'background': 160,
 'comment': None,
 'duration': 500,
 'optimize': True,
 'version': b'GIF89a'}

image

Check out libsimdpp, it should help supporting multiple platforms

Hi, just noticed this new SIMDified library in development through a Hacker News post. If cross-platform SIMD support is among your objectives, I think you should check out libsimdpp (https://github.com/p12tic/libsimdpp). It allows you to write the SIMD code once, then compile it for different instruction sets, combine the resulting object files into single library and then dispatch depending on the actual CPU type on runtime. For relatively simple code such as image processing such multi-platform support would be straightforward. At the moment libsimdpp already supports the most popular SIMD instruction sets: SSE2 to SSE4.1, XOP, AVX, AVX2, AVX512F, NEON and Altivec, with AVX512BW/DQ, MIPS MSA and POWER7/8 VSX support being in development.

Disclosure: I'm the author of libsimdpp.

Install error on Centos7

What did you do?

yum -y install python34-pip
pip3 install --upgrade pip
pip3 install pillow-simd

What actually happened?

[root@smxr1 ~]#  yum -y install python34-pip
Загружены модули: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.wiuwiu.de
 * epel: mirror.daniel-jost.net
 * extras: mirror.wiuwiu.de
 * remi: remi.schlundtech.de
 * remi-php55: remi.schlundtech.de
 * remi-safe: remi.schlundtech.de
 * updates: mirror.wiuwiu.de
Пакет python34-pip-8.1.2-5.el7.noarch уже установлен, и это последняя версия.
Выполнять нечего
[root@smxr1 ~]# pip3 install pillow-simd
Collecting pillow-simd
  Using cached Pillow-SIMD-4.0.0.post0.tar.gz
Requirement already satisfied: olefile in /usr/lib/python3.4/site-packages (from pillow-simd)
Installing collected packages: pillow-simd
  Running setup.py install for pillow-simd ... error
    Complete output from command /usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qi8l4imo/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_83d2egh-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.4
    creating build/lib.linux-x86_64-3.4/PIL
    copying PIL/__init__.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/_binary.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/_util.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ContainerIO.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ExifTags.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/features.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/FontFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/GdImageFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/Image.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageChops.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageCms.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageColor.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageDraw.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageFilter.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageFont.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageGrab.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageMath.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageMode.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageMorph.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageOps.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImagePalette.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImagePath.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageQt.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageSequence.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageShow.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageStat.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageTk.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageTransform.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImageWin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/JpegPresets.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/OleFileIO.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PaletteFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PSDraw.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/PyAccess.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/TarIO.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/TiffTags.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/WalImageFile.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.4/PIL
    running egg_info
    writing dependency_links to Pillow_SIMD.egg-info/dependency_links.txt
    writing requirements to Pillow_SIMD.egg-info/requires.txt
    writing top-level names to Pillow_SIMD.egg-info/top_level.txt
    writing Pillow_SIMD.egg-info/PKG-INFO
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'Pillow_SIMD.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 '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    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_SIMD.egg-info/SOURCES.txt'
    copying PIL/.DS_Store -> build/lib.linux-x86_64-3.4/PIL
    running build_ext


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

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

    Traceback (most recent call last):
      File "/tmp/pip-build-qi8l4imo/pillow-simd/setup.py", line 780, in <module>
        zip_safe=not debug_build(), )
      File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.4/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib64/python3.4/distutils/command/install.py", line 539, in run
        self.run_command('build')
      File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib64/python3.4/distutils/command/build.py", line 126, in run
        self.run_command(cmd_name)
      File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib64/python3.4/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/tmp/pip-build-qi8l4imo/pillow-simd/setup.py", line 549, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: zlib

    During handling of the above exception, another exception occurred:

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

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

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



    ----------------------------------------
Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qi8l4imo/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_83d2egh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-qi8l4imo/pillow-simd/

What versions of Pillow and Python are you using?

Pillow 4.0.0
Python 3.4.5

pkg_resources.DistributionNotFound message after installing SIMD 4.3.0.post0

What did you do?

Execute these commands (Dockerfile) from a CentOS 7 base image:

RUN set -x \
  && pip install --upgrade pip \
  && pip install --upgrade setuptools \
  && pip install pexif==0.15 \
  && pip install -e git+https://github.com/thumbor/thumbor.git@master#egg=thumbor \
  && pip install opencv-engine==1.0.1 \
  && pip install thumbor-s3==0.2.0 \
  && pip install tc-prometheus==0.1.1 \
  && pip uninstall -y pillow || true \
  && pip install -U --force-reinstall pillow-simd \
  && python -c "from PIL import Image; print(Image.PILLOW_VERSION)" \
  && pip list

What did you expect to happen?

That pillow-simd is a replacement package for pillow.

What actually happened?

I get this this error message when running thumbor:

Traceback (most recent call last):
  File "/usr/bin/thumbor", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3142, in <module>
    @_call_aside
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3126, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3155, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 664, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 981, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 867, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Pillow<5.0.0,>=3.0.0' distribution was not found and is required by thumbor

What versions of Pillow and Python are you using?

Pillow: 4.3.0.post0
Python: 2.7.5

Running setup.py bdist_wheel for pillow-simd ... error

What did you do?

pip3 install pillow-simd

What did you expect to happen?

something promissing

What actually happened?

trace below

What versions of Pillow and Python are you using?

python 3.6.3, Pillow 4.3.0 (classic one) Ubuntu 17.10/16.04 (docker)
Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.

The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.

alex@alex:~$ pip3 install pillow-simd
Collecting pillow-simd
  Using cached Pillow-SIMD-4.3.0.post0.tar.gz
Collecting olefile (from pillow-simd)
Building wheels for collected packages: pillow-simd
  Running setup.py bdist_wheel for pillow-simd ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zfi50c_8/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpgmim6gj1pip-wheel- --python-tag cp36:
  Single threaded build, not installing mp_compile:1 processes
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageFilter.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageFont.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageColor.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageStat.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/GdImageFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageChops.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImagePalette.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/__init__.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageDraw.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/_util.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ExifTags.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImagePath.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/JpegPresets.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageShow.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/OleFileIO.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/features.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageGrab.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageWin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/TiffTags.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ContainerIO.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageMath.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/version.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/Image.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/_binary.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/FontFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageOps.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageMode.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/TarIO.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PyAccess.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/WalImageFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageMorph.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageQt.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageSequence.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PSDraw.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageCms.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageTransform.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying PIL/ImageTk.py -> build/lib.linux-x86_64-3.6/PIL
  running egg_info
  writing Pillow_SIMD.egg-info/PKG-INFO
  writing dependency_links to Pillow_SIMD.egg-info/dependency_links.txt
  writing requirements to Pillow_SIMD.egg-info/requires.txt
  writing top-level names to Pillow_SIMD.egg-info/top_level.txt
  reading manifest file 'Pillow_SIMD.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_SIMD.egg-info/SOURCES.txt'
  copying PIL/.DS_Store -> build/lib.linux-x86_64-3.6/PIL
  running build_ext
  
  
  The headers or library files could not be found for zlib,
  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-zfi50c_8/pillow-simd/setup.py", line 788, in <module>
      zip_safe=not (debug_build() or PLATFORM_MINGW), )
    File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 179, in run
      self.run_command('build')
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/tmp/pip-build-zfi50c_8/pillow-simd/setup.py", line 577, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: zlib
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-zfi50c_8/pillow-simd/setup.py", line 800, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:
  
  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  
  
  ----------------------------------------
  Failed building wheel for pillow-simd
  Running setup.py clean for pillow-simd
Failed to build pillow-simd
Installing collected packages: olefile, pillow-simd
  Running setup.py install for pillow-simd ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zfi50c_8/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0a2hlr7w-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    Single threaded build, not installing mp_compile:1 processes
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageFilter.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageFont.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageColor.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageStat.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/GdImageFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageChops.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImagePalette.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/__init__.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageDraw.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/_util.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ExifTags.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImagePath.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/JpegPresets.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageShow.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/OleFileIO.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/features.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageGrab.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageWin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/TiffTags.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ContainerIO.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageMath.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/version.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/Image.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/_binary.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/FontFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageOps.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageMode.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/TarIO.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PyAccess.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/WalImageFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageMorph.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageQt.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageSequence.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PSDraw.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageCms.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageTransform.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying PIL/ImageTk.py -> build/lib.linux-x86_64-3.6/PIL
    running egg_info
    writing Pillow_SIMD.egg-info/PKG-INFO
    writing dependency_links to Pillow_SIMD.egg-info/dependency_links.txt
    writing requirements to Pillow_SIMD.egg-info/requires.txt
    writing top-level names to Pillow_SIMD.egg-info/top_level.txt
    reading manifest file 'Pillow_SIMD.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_SIMD.egg-info/SOURCES.txt'
    copying PIL/.DS_Store -> build/lib.linux-x86_64-3.6/PIL
    running build_ext
    
    
    The headers or library files could not be found for zlib,
    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-zfi50c_8/pillow-simd/setup.py", line 788, in <module>
        zip_safe=not (debug_build() or PLATFORM_MINGW), )
      File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
        self.run_command('build')
      File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/tmp/pip-build-zfi50c_8/pillow-simd/setup.py", line 577, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: zlib
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-zfi50c_8/pillow-simd/setup.py", line 800, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:
    
    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    
    
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zfi50c_8/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0a2hlr7w-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-zfi50c_8/pillow-simd/

Pillow SIMD 6.0.0 release?

Are there any plans/timelines for a 6.0.0 release?

Context: I am working on an issue regarding the piexif library that affects thumbor. We can drop the piexif dependency with new EXIF write capabilities in the Pillow 6.0.0 release. But there is a fairly strong desire to be able to use pillow-simd [convo]. So it would really mean a lot to the Thumbor project if we could get a 6.0.0 release.

Thanks for all your awesome work on pillow-simd!!

not support webp?

What did you do?

installed the latest version of pillow-simd and then test it against a webp image.

What did you expect to happen?

pillow-simd should identify webp image.

libwebp has already been installed.

[root@01065038-83ac-4563-a33b-5542de40a0de static]# ldconfig -p|grep -i webp
        libwebpmux.so.0 (libc6,x86-64) => /lib64/libwebpmux.so.0
        libwebp.so.4 (libc6,x86-64) => /lib64/libwebp.so.4

What actually happened?

IOError when opening a webp image:

[root@01065038-83ac-4563-a33b-5542de40a0de static]# ll
total 1680
-rw-r--r-- 1 root root  176972 Dec 14 18:29 cherry.webp
-rw-r--r-- 1 root root  163759 Dec 14 18:29 dog.jpg
-rw-r--r-- 1 root root   42927 Dec 14 18:29 face.jpg
-rw-r--r-- 1 root root  107954 Dec 14 18:29 jobs.png
-rw-r--r-- 1 root root 1216868 Dec 14 18:29 test.gif
[root@01065038-83ac-4563-a33b-5542de40a0de static]# python
Python 2.7.5 (default, Sep 15 2016, 22:37:39) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> Image.open('cherry.webp')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 2519, in open
    % (filename if filename else fp))
IOError: cannot identify image file 'cherry.webp'

What versions of Pillow and Python are you using?

I have tried the latest version(4.3.0.post0) and 4.2.1.post0 of pillow-simd

Python version: 2.7.5

Github doesn't support webp image upload. The test image is here: http://www.gstatic.com/webp/gallery/4.webp

Install failing on windows 10

What did you do?

I tried to install pillow-simd using:
pip install pillow-simd --global-option="build_ext" --global-option="--disable-zlib" --global-option="--disable-jpeg"

It has failed previously due to lack of zlib and and libjpeg. (I don't need those features anyway)

What actually happened?

Failed with the error:

C:\tools\python2\lib\site-packages\pip\commands\install.py:180: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Collecting pillow-simd
  Using cached Pillow-SIMD-3.3.0.post2.tar.gz
Skipping bdist_wheel for pillow-simd, due to binaries being disabled for it.
Installing collected packages: pillow-simd
  Running setup.py install for pillow-simd ... error
    Complete output from command c:\tools\python2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\vszm\\appdata\\local\\temp\\pip-build-dqh1fb\\pillow-simd\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-zlib --disable-jpeg install --record c:\users\vszm\appdata\local\temp\pip-agodnb-record\install-record.txt --single-version-externally-managed --compile:
    Single threaded build for windows
    running build_ext
    building 'PIL._imaging' extension
    creating build
    creating build\temp.win-amd64-2.7
    creating build\temp.win-amd64-2.7\Release
    creating build\temp.win-amd64-2.7\Release\libImaging
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tc_imaging.c /Fobuild\temp.win-amd64-2.7\Release\_imaging.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    _imaging.c
    _imaging.c(531) : warning C4244: '=' : conversion from '__int64' to 'char', possible loss of data
    _imaging.c(545) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data
    _imaging.c(551) : warning C4244: '=' : conversion from '__int64' to 'char', possible loss of data
    _imaging.c(561) : warning C4244: '=' : conversion from '__int64' to 'INT32', possible loss of data
    _imaging.c(2686) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    _imaging.c(3144) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tcdecode.c /Fobuild\temp.win-amd64-2.7\Release\decode.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    decode.c
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tcencode.c /Fobuild\temp.win-amd64-2.7\Release\encode.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    encode.c
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tcmap.c /Fobuild\temp.win-amd64-2.7\Release\map.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    map.c
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tcdisplay.c /Fobuild\temp.win-amd64-2.7\Release\display.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    display.c
    display.c(542) : warning C4244: '=' : conversion from 'SIZE_T' to 'int', possible loss of data
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tcoutline.c /Fobuild\temp.win-amd64-2.7\Release\outline.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    outline.c
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /Tcpath.c /Fobuild\temp.win-amd64-2.7\Release\path.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    path.c
    path.c(131) : warning C4244: 'initializing' : conversion from 'unsigned __int64' to 'int', possible loss of data
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /TclibImaging\Access.c /Fobuild\temp.win-amd64-2.7\Release\libImaging\Access.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    Access.c
    C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\libImaging -IC:\tools\python2\include -IC:\tools\python2\include -IC:\tools\python2\PC /TclibImaging\AlphaComposite.c /Fobuild\temp.win-amd64-2.7\Release\libImaging\AlphaComposite.obj -msse4
    cl : Command line warning D9002 : ignoring unknown option '-msse4'
    AlphaComposite.c
    libImaging\AlphaComposite.c(173) : error C2275: '__m128i' : illegal use of this type as an expression
            C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\emmintrin.h(45) : see declaration of '__m128i'
    libImaging\AlphaComposite.c(173) : error C2146: syntax error : missing ';' before identifier 'mm_coef2'
    libImaging\AlphaComposite.c(173) : error C2065: 'mm_coef2' : undeclared identifier
    libImaging\AlphaComposite.c(173) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(175) : error C2275: '__m128i' : illegal use of this type as an expression
            C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\emmintrin.h(45) : see declaration of '__m128i'
    libImaging\AlphaComposite.c(175) : error C2146: syntax error : missing ';' before identifier 'mm_out_lo'
    libImaging\AlphaComposite.c(175) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(177) : error C2065: 'mm_coef2' : undeclared identifier
    libImaging\AlphaComposite.c(177) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(177) : warning C4024: '_mm_shuffle_epi8' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(177) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(178) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(178) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(178) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(178) : warning C4024: '_mm_or_si128' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(179) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(180) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(180) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(180) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(180) : warning C4024: '_mm_add_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(180) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(181) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(181) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(181) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(181) : warning C4024: '_mm_add_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(181) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(181) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(181) : warning C4024: '_mm_srli_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(181) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(183) : error C2275: '__m128i' : illegal use of this type as an expression
            C:\Users\VSZM\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\emmintrin.h(45) : see declaration of '__m128i'
    libImaging\AlphaComposite.c(183) : error C2146: syntax error : missing ';' before identifier 'mm_out_hi'
    libImaging\AlphaComposite.c(183) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(185) : error C2065: 'mm_coef2' : undeclared identifier
    libImaging\AlphaComposite.c(185) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(185) : warning C4024: '_mm_shuffle_epi8' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(185) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(186) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(186) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(186) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(186) : warning C4024: '_mm_or_si128' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(187) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(188) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(188) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(188) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(188) : warning C4024: '_mm_add_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(188) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(189) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(189) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(189) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(189) : warning C4024: '_mm_add_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(189) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(189) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(189) : warning C4024: '_mm_srli_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(189) : error C2440: '=' : cannot convert from '__m128i' to 'int'
    libImaging\AlphaComposite.c(192) : error C2065: 'mm_out_lo' : undeclared identifier
    libImaging\AlphaComposite.c(192) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(192) : warning C4024: '_mm_packus_epi16' : different types for formal and actual parameter 1
    libImaging\AlphaComposite.c(192) : error C2065: 'mm_out_hi' : undeclared identifier
    libImaging\AlphaComposite.c(192) : error C2440: 'function' : cannot convert from 'int' to '__m128i'
    libImaging\AlphaComposite.c(192) : warning C4024: '_mm_packus_epi16' : different types for formal and actual parameter 2
    error: command 'C:\\Users\\VSZM\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\tools\python2\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\vszm\\appdata\\local\\temp\\pip-build-dqh1fb\\pillow-simd\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-zlib --disable-jpeg install --record c:\users\vszm\appdata\local\temp\pip-agodnb-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\vszm\appdata\local\temp\pip-build-dqh1fb\pillow-simd\

What versions of Pillow and Python are you using?

Pillow-SIMD-3.3.0.post2.tar.gz
Python 2.7.10 (default, May 23 2015, 09:44:00)

How to install to python docker

What did you do?

I try install pillow-simd to docker
And receiwe failed build:

 The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html

Bat zlib1g-dev install in image and zlib.h has in /usr/include

What actually happened?

I create Dockerfile:

FROM python:3.6.5
RUN apt-get install libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
RUN pip install -U pip
RUN pip install -U Pillow-SIMD

Run build and receive error:

$ docker build -t pillow-simd .
Sending build context to Docker daemon  70.12MB
Step 1/4 : FROM python:3.6.5
 ---> efb6baa1169f
Step 2/4 : RUN apt-get install libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
 ---> Using cache
 ---> 44d4338da18e
Step 3/4 : RUN pip install -U pip
 ---> Using cache
 ---> 868a8c2370bb
Step 4/4 : RUN pip install -U Pillow-SIMD
 ---> Running in 92ce2a76a5fa
Collecting Pillow-SIMD
  Downloading Pillow-SIMD-5.1.1.post0.tar.gz (14.2MB)
Building wheels for collected packages: Pillow-SIMD
  Running setup.py bdist_wheel for Pillow-SIMD: started
  Running setup.py bdist_wheel for Pillow-SIMD: finished with status 'error'
  Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-68k_4p96/Pillow-SIMD/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-t85ysk4w --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/_util.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/features.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/Image.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/OleFileIO.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/version.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
  running egg_info
  writing src/Pillow_SIMD.egg-info/PKG-INFO
  writing dependency_links to src/Pillow_SIMD.egg-info/dependency_links.txt
  writing top-level names to src/Pillow_SIMD.egg-info/top_level.txt
  reading manifest file 'src/Pillow_SIMD.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'
  no previously-included directories found matching 'docs/_static'
  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 '.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 '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 'src/Pillow_SIMD.egg-info/SOURCES.txt'
  copying src/PIL/.DS_Store -> build/lib.linux-x86_64-3.6/PIL
  running build_ext
  
  
  The headers or library files could not be found for zlib,
  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-68k_4p96/Pillow-SIMD/setup.py", line 795, in <module>
      zip_safe=not (debug_build() or PLATFORM_MINGW), )
    File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    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/wheel/bdist_wheel.py", line 204, 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-install-68k_4p96/Pillow-SIMD/setup.py", line 582, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: zlib
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-68k_4p96/Pillow-SIMD/setup.py", line 807, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:
  
  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  
  
  ----------------------------------------
  Failed building wheel for Pillow-SIMD
  Running setup.py clean for Pillow-SIMD
Failed to build Pillow-SIMD
Installing collected packages: Pillow-SIMD
  Running setup.py install for Pillow-SIMD: started
    Running setup.py install for Pillow-SIMD: finished with status 'error'
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-68k_4p96/Pillow-SIMD/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-brhblj2t/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/_util.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/features.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/Image.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/OleFileIO.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/version.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
    running egg_info
    writing src/Pillow_SIMD.egg-info/PKG-INFO
    writing dependency_links to src/Pillow_SIMD.egg-info/dependency_links.txt
    writing top-level names to src/Pillow_SIMD.egg-info/top_level.txt
    reading manifest file 'src/Pillow_SIMD.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'
    no previously-included directories found matching 'docs/_static'
    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 '.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 '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 'src/Pillow_SIMD.egg-info/SOURCES.txt'
    copying src/PIL/.DS_Store -> build/lib.linux-x86_64-3.6/PIL
    running build_ext
    
    
    The headers or library files could not be found for zlib,
    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-68k_4p96/Pillow-SIMD/setup.py", line 795, in <module>
        zip_safe=not (debug_build() or PLATFORM_MINGW), )
      File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      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-install-68k_4p96/Pillow-SIMD/setup.py", line 582, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: zlib
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-68k_4p96/Pillow-SIMD/setup.py", line 807, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:
    
    The headers or library files could not be found for zlib,
    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/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-68k_4p96/Pillow-SIMD/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-brhblj2t/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-68k_4p96/Pillow-SIMD/
The command '/bin/sh -c pip install -U Pillow-SIMD' returned a non-zero code: 1

What versions of Pillow and Python are you using?

Pillow-SIMD 5.1.1
Python 3.6.5

Exception on image thumbnailing

What did you do?

Run thumbor with pillow-simd==4.3.0.post0 to do on-demand thumbnailing on huge variety of images.

What did you expect to happen?

The images being thumbnailed

What actually happened?

When trying to thumbnail http://1.bp.blogspot.com/-ekhKVXl7xto/T6-2WZMYpTI/AAAAAAAAGiQ/ioOs_2BfXPA/s1600/Images+for+Dog+:++Wallpaper+:+Cute+:+Funny+:+Beautiful+Puppies8.jpg (the local thumbor url would be: http://localhost:8888/unsafe/0x390/smart/http://1.bp.blogspot.com/-ekhKVXl7xto/T6-2WZMYpTI/AAAAAAAAGiQ/ioOs_2BfXPA/s1600/Images+for+Dog+:++Wallpaper+:+Cute+:+Funny+:+Beautiful+Puppies8.jpg) we get the following stacktrace:

2018-05-24 11:00:11 thumbor:ERROR [ThreadPool] encoder error -2 when writing image file
Traceback (most recent call last):
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/context.py", line 272, in _execute_in_foreground
    returned = operation()
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/handlers/__init__.py", line 345, in _load_results
    results = context.request.engine.read(image_extension, quality)
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/engines/pil.py", line 262, in read
    self.image.save(img_buffer, FORMATS[ext])
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_4_3_0_post0/PIL/Image.py", line 1928, in save
    save_handler(self, fp, filename)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_4_3_0_post0/PIL/JpegImagePlugin.py", line 746, in _save
    ImageFile._save(im, fp, [("jpeg", (0, 0)+im.size, 0, rawmode)], bufsize)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_4_3_0_post0/PIL/ImageFile.py", line 495, in _save
    raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file

If I change back to normal pillow 4.3.0 it all works fine.

What versions of Pillow and Python are you using?

Pillow 4.3.0 / 4.3.0.post0
Python 2.7

EDIT:
Also tried with latest pillow simd 5.1.1 and getting basically the same exception:

2018-05-24 11:16:02 thumbor:ERROR Could not save as improved image, consider to increase ImageFile.MAXBLOCK
Traceback (most recent call last):
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/engines/pil.py", line 266, in read
    self.image.save(img_buffer, self.image.format, **options)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_5_1_1_post0/PIL/Image.py", line 1935, in save
    save_handler(self, fp, filename)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_5_1_1_post0/PIL/JpegImagePlugin.py", line 761, in _save
    ImageFile._save(im, fp, [("jpeg", (0, 0)+im.size, 0, rawmode)], bufsize)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_5_1_1_post0/PIL/ImageFile.py", line 496, in _save
    raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file
Bogus input colorspace
2018-05-24 11:16:02 thumbor:ERROR [ThreadPool] encoder error -2 when writing image file
Traceback (most recent call last):
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/context.py", line 272, in _execute_in_foreground
    returned = operation()
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/handlers/__init__.py", line 345, in _load_results
    results = context.request.engine.read(image_extension, quality)
  File "/app/thumbor_server/image.binary.runfiles/pypi__thumbor_6_4_2/thumbor/engines/pil.py", line 269, in read
    self.image.save(img_buffer, FORMATS[ext])
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_5_1_1_post0/PIL/Image.py", line 1935, in save
    save_handler(self, fp, filename)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_5_1_1_post0/PIL/JpegImagePlugin.py", line 761, in _save
    ImageFile._save(im, fp, [("jpeg", (0, 0)+im.size, 0, rawmode)], bufsize)
  File "/app/thumbor_server/image.binary.runfiles/pypi__Pillow_SIMD_5_1_1_post0/PIL/ImageFile.py", line 496, in _save
    raise IOError("encoder error %d when writing image file" % s)
IOError: encoder error -2 when writing image file
2018-05-24 11:16:02 thumbor:ERROR [BaseHander.finish_request] encoder error -2 when writing image file

Fill Imaging with RAW YUV/RGB(A) buffer

Hi ! Is there a way to fill the Imaging struct with RAW YUV/RGB(A) buffer ?
I'm trying to create C only library and do not want to reinvent the wheel.
Thanks.

Does pillow-simd suport WEBP conversion?

What did you do?

I tried convert a jpg image into WEBP image.

What did you expect to happen?

I expect a conversion, without errors.

What actually happened?

I got a error. When a install the the pillow: pip install Pillow the code works fine. But when:

$ pip uninstall pillow
$ CC="cc -mavx2" pip install -U --force-reinstall pillow-simd

It's giving the error.

Does pillow-simd suport WEBP conversion?

What are your OS, Python and Pillow versions?

  • OS:

    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.5 LTS
    Release: 16.04
    Codename: xenial

  • Python:

    Python 2.7.12 (default, Nov 12 2018, 14:36:49)
    Type "copyright", "credits" or "license" for more information.

    IPython 3.0.0 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object', use 'object??' for extra details.

  • Pillow:

    Pillow-SIMD==5.3.0.post0

    In [1]: import StringIO

    In [2]: from PIL import Image as PilImage

    In [3]: img = PilImage.open('222.jpg')

    In [4]: originalThumbStr = StringIO.StringIO()

    In [5]: img.convert('RGBA').save(originalThumbStr, 'webp', quality=75)
    ---------------------------------------------------------------------------
    KeyError                                  Traceback (most recent call last)
    <ipython-input-5-d3ca76f0559d> in <module>()
    ----> 1 img.convert('RGBA').save(originalThumbStr, 'webp', quality=75)

    /home/developer/.virtualenvs/prisvo/local/lib/python2.7/site-packages/PIL/Image.pyc in save(self, fp, format, **params)
       1956             save_handler = SAVE_ALL[format.upper()]
       1957         else:
    -> 1958             save_handler = SAVE[format.upper()]
       1959 
       1960         if open_fp:

    KeyError: 'WEBP'

    In [6]: 

AVX2 version is slower than SSE4

What did you do?

I use azure app service and visual studio load testing
Processor is Intel Xeon E5-2673v3 with 1 core, avx2 is there when I do cat /proc/cpuinfo
installed avx2 version using CC="cc -mavx2" pip install -U --force-reinstall pillow-simd
I run service in docker on ubuntu 17.10 so I did RUN CC="cc -mavx2" pip install -U --force-reinstall pillow-simd inside docker file. It shows that a pillow-simd-4.3.0.post0 was installed (so correct one).

What did you expect to happen?

image processing with a speed of light

What actually happened?

30% slower on avg than regu;ar pillow-simd without avx2 flag

What versions of Pillow and Python are you using?

latest pillow-simd Python 3.6.3

Segfault on ImagingResampleHorizontalConvolution8u4x

Segfault on ImagingResampleHorizontalConvolution8u4x (used by lutris).

Version: python-pillow-simd-git 6.0.x.post0.r0.g629f8d18-1 (https://github.com/uploadcare/pillow-simd/tree/629f8d188d0796140fe4a985a951b4d271defe30)

When launching lutris 0.5.3 with Pillow-simd instead of Pillow, Lutris core dumps. COnfirmed in 3 other separate reports:

Reproduction from lutris/lutris#2232:

gdb --args /usr/bin/python /usr/bin/lutris
[...]
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff3b1c16e in ImagingResampleHorizontalConvolution8u4x () from /usr/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so
 
(gdb) bt
#0  0x00007ffff3b1c16e in ImagingResampleHorizontalConvolution8u4x () at /usr/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so
#1  0x00007ffff3b1d01f in ImagingResampleHorizontal_8bpc () at /usr/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so
#2  0x00007ffff3b1d3f6 in ImagingResampleInner () at /usr/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so
#3  0x00007ffff3b1d643 in ImagingResample () at /usr/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so
#4  0x00007ffff3b15194 in  () at /usr/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so
[...]

I expected it's due to AVX2 alignment issue given the source code:

void
ImagingResampleHorizontalConvolution8u4x(
UINT32 *lineOut0, UINT32 *lineOut1, UINT32 *lineOut2, UINT32 *lineOut3,
UINT32 *lineIn0, UINT32 *lineIn1, UINT32 *lineIn2, UINT32 *lineIn3,
int xsize, int *xbounds, INT16 *kk, int kmax, int coefs_precision)
{
int xmin, xmax, xx, x;
INT16 *k;
for (xx = 0; xx < xsize; xx++) {
xmin = xbounds[xx * 2 + 0];
xmax = xbounds[xx * 2 + 1];
k = &kk[xx * kmax];
x = 0;
#if defined(__AVX2__)
{
__m256i sss0, sss1;
__m256i zero = _mm256_setzero_si256();
__m256i initial = _mm256_set1_epi32(1 << (coefs_precision-1));
sss0 = initial;
sss1 = initial;
for (; x < xmax - 3; x += 4) {
__m256i pix, mmk0, mmk1, source;
mmk0 = _mm256_set1_epi32(*(INT32 *) &k[x]);
mmk1 = _mm256_set1_epi32(*(INT32 *) &k[x + 2]);
source = _mm256_inserti128_si256(_mm256_castsi128_si256(
_mm_loadu_si128((__m128i *) &lineIn0[x + xmin])),
_mm_loadu_si128((__m128i *) &lineIn1[x + xmin]), 1);
pix = _mm256_shuffle_epi8(source, _mm256_set_epi8(
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0,
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0));
sss0 = _mm256_add_epi32(sss0, _mm256_madd_epi16(pix, mmk0));
pix = _mm256_shuffle_epi8(source, _mm256_set_epi8(
-1,15, -1,11, -1,14, -1,10, -1,13, -1,9, -1,12, -1,8,
-1,15, -1,11, -1,14, -1,10, -1,13, -1,9, -1,12, -1,8));
sss0 = _mm256_add_epi32(sss0, _mm256_madd_epi16(pix, mmk1));
source = _mm256_inserti128_si256(_mm256_castsi128_si256(
_mm_loadu_si128((__m128i *) &lineIn2[x + xmin])),
_mm_loadu_si128((__m128i *) &lineIn3[x + xmin]), 1);
pix = _mm256_shuffle_epi8(source, _mm256_set_epi8(
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0,
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0));
sss1 = _mm256_add_epi32(sss1, _mm256_madd_epi16(pix, mmk0));
pix = _mm256_shuffle_epi8(source, _mm256_set_epi8(
-1,15, -1,11, -1,14, -1,10, -1,13, -1,9, -1,12, -1,8,
-1,15, -1,11, -1,14, -1,10, -1,13, -1,9, -1,12, -1,8));
sss1 = _mm256_add_epi32(sss1, _mm256_madd_epi16(pix, mmk1));
}
for (; x < xmax - 1; x += 2) {
__m256i pix, mmk;
mmk = _mm256_set1_epi32(*(INT32 *) &k[x]);
pix = _mm256_inserti128_si256(_mm256_castsi128_si256(
_mm_loadl_epi64((__m128i *) &lineIn0[x + xmin])),
_mm_loadl_epi64((__m128i *) &lineIn1[x + xmin]), 1);
pix = _mm256_shuffle_epi8(pix, _mm256_set_epi8(
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0,
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0));
sss0 = _mm256_add_epi32(sss0, _mm256_madd_epi16(pix, mmk));
pix = _mm256_inserti128_si256(_mm256_castsi128_si256(
_mm_loadl_epi64((__m128i *) &lineIn2[x + xmin])),
_mm_loadl_epi64((__m128i *) &lineIn3[x + xmin]), 1);
pix = _mm256_shuffle_epi8(pix, _mm256_set_epi8(
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0,
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0));
sss1 = _mm256_add_epi32(sss1, _mm256_madd_epi16(pix, mmk));
}
for (; x < xmax; x ++) {
__m256i pix, mmk;
// [16] xx k0 xx k0 xx k0 xx k0 xx k0 xx k0 xx k0 xx k0
mmk = _mm256_set1_epi32(k[x]);
// [16] xx a0 xx b0 xx g0 xx r0 xx a0 xx b0 xx g0 xx r0
pix = _mm256_inserti128_si256(_mm256_castsi128_si256(
_mm_cvtepu8_epi32(*(__m128i *) &lineIn0[x + xmin])),
_mm_cvtepu8_epi32(*(__m128i *) &lineIn1[x + xmin]), 1);
sss0 = _mm256_add_epi32(sss0, _mm256_madd_epi16(pix, mmk));
pix = _mm256_inserti128_si256(_mm256_castsi128_si256(
_mm_cvtepu8_epi32(*(__m128i *) &lineIn2[x + xmin])),
_mm_cvtepu8_epi32(*(__m128i *) &lineIn3[x + xmin]), 1);
sss1 = _mm256_add_epi32(sss1, _mm256_madd_epi16(pix, mmk));
}
sss0 = _mm256_srai_epi32(sss0, coefs_precision);
sss1 = _mm256_srai_epi32(sss1, coefs_precision);
sss0 = _mm256_packs_epi32(sss0, zero);
sss1 = _mm256_packs_epi32(sss1, zero);
sss0 = _mm256_packus_epi16(sss0, zero);
sss1 = _mm256_packus_epi16(sss1, zero);
lineOut0[xx] = _mm_cvtsi128_si32(_mm256_extracti128_si256(sss0, 0));
lineOut1[xx] = _mm_cvtsi128_si32(_mm256_extracti128_si256(sss0, 1));
lineOut2[xx] = _mm_cvtsi128_si32(_mm256_extracti128_si256(sss1, 0));
lineOut3[xx] = _mm_cvtsi128_si32(_mm256_extracti128_si256(sss1, 1));
}
#else
{
__m128i sss0, sss1, sss2, sss3;
__m128i initial = _mm_set1_epi32(1 << (coefs_precision-1));
sss0 = initial;
sss1 = initial;
sss2 = initial;
sss3 = initial;
for (; x < xmax - 3; x += 4) {
__m128i pix, mmk_lo, mmk_hi, source;
__m128i mask_lo = _mm_set_epi8(
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0);
__m128i mask_hi = _mm_set_epi8(
-1,15, -1,11, -1,14, -1,10, -1,13, -1,9, -1,12, -1,8);
mmk_lo = _mm_set1_epi32(*(INT32 *) &k[x]);
mmk_hi = _mm_set1_epi32(*(INT32 *) &k[x + 2]);
// [8] a3 b3 g3 r3 a2 b2 g2 r2 a1 b1 g1 r1 a0 b0 g0 r0
source = _mm_loadu_si128((__m128i *) &lineIn0[x + xmin]);
// [16] a1 a0 b1 b0 g1 g0 r1 r0
pix = _mm_shuffle_epi8(source, mask_lo);
sss0 = _mm_add_epi32(sss0, _mm_madd_epi16(pix, mmk_lo));
// [16] a3 a2 b3 b2 g3 g2 r3 r2
pix = _mm_shuffle_epi8(source, mask_hi);
sss0 = _mm_add_epi32(sss0, _mm_madd_epi16(pix, mmk_hi));
source = _mm_loadu_si128((__m128i *) &lineIn1[x + xmin]);
pix = _mm_shuffle_epi8(source, mask_lo);
sss1 = _mm_add_epi32(sss1, _mm_madd_epi16(pix, mmk_lo));
pix = _mm_shuffle_epi8(source, mask_hi);
sss1 = _mm_add_epi32(sss1, _mm_madd_epi16(pix, mmk_hi));
source = _mm_loadu_si128((__m128i *) &lineIn2[x + xmin]);
pix = _mm_shuffle_epi8(source, mask_lo);
sss2 = _mm_add_epi32(sss2, _mm_madd_epi16(pix, mmk_lo));
pix = _mm_shuffle_epi8(source, mask_hi);
sss2 = _mm_add_epi32(sss2, _mm_madd_epi16(pix, mmk_hi));
source = _mm_loadu_si128((__m128i *) &lineIn3[x + xmin]);
pix = _mm_shuffle_epi8(source, mask_lo);
sss3 = _mm_add_epi32(sss3, _mm_madd_epi16(pix, mmk_lo));
pix = _mm_shuffle_epi8(source, mask_hi);
sss3 = _mm_add_epi32(sss3, _mm_madd_epi16(pix, mmk_hi));
}
for (; x < xmax - 1; x += 2) {
__m128i pix, mmk;
__m128i mask = _mm_set_epi8(
-1,7, -1,3, -1,6, -1,2, -1,5, -1,1, -1,4, -1,0);
// [16] k1 k0 k1 k0 k1 k0 k1 k0
mmk = _mm_set1_epi32(*(INT32 *) &k[x]);
// [8] x x x x x x x x a1 b1 g1 r1 a0 b0 g0 r0
pix = _mm_loadl_epi64((__m128i *) &lineIn0[x + xmin]);
// [16] a1 a0 b1 b0 g1 g0 r1 r0
pix = _mm_shuffle_epi8(pix, mask);
sss0 = _mm_add_epi32(sss0, _mm_madd_epi16(pix, mmk));
pix = _mm_loadl_epi64((__m128i *) &lineIn1[x + xmin]);
pix = _mm_shuffle_epi8(pix, mask);
sss1 = _mm_add_epi32(sss1, _mm_madd_epi16(pix, mmk));
pix = _mm_loadl_epi64((__m128i *) &lineIn2[x + xmin]);
pix = _mm_shuffle_epi8(pix, mask);
sss2 = _mm_add_epi32(sss2, _mm_madd_epi16(pix, mmk));
pix = _mm_loadl_epi64((__m128i *) &lineIn3[x + xmin]);
pix = _mm_shuffle_epi8(pix, mask);
sss3 = _mm_add_epi32(sss3, _mm_madd_epi16(pix, mmk));
}
for (; x < xmax; x ++) {
__m128i pix, mmk;
// [16] xx k0 xx k0 xx k0 xx k0
mmk = _mm_set1_epi32(k[x]);
// [16] xx a0 xx b0 xx g0 xx r0
pix = _mm_cvtepu8_epi32(*(__m128i *) &lineIn0[x + xmin]);
sss0 = _mm_add_epi32(sss0, _mm_madd_epi16(pix, mmk));
pix = _mm_cvtepu8_epi32(*(__m128i *) &lineIn1[x + xmin]);
sss1 = _mm_add_epi32(sss1, _mm_madd_epi16(pix, mmk));
pix = _mm_cvtepu8_epi32(*(__m128i *) &lineIn2[x + xmin]);
sss2 = _mm_add_epi32(sss2, _mm_madd_epi16(pix, mmk));
pix = _mm_cvtepu8_epi32(*(__m128i *) &lineIn3[x + xmin]);
sss3 = _mm_add_epi32(sss3, _mm_madd_epi16(pix, mmk));
}
sss0 = _mm_srai_epi32(sss0, coefs_precision);
sss1 = _mm_srai_epi32(sss1, coefs_precision);
sss2 = _mm_srai_epi32(sss2, coefs_precision);
sss3 = _mm_srai_epi32(sss3, coefs_precision);
sss0 = _mm_packs_epi32(sss0, sss0);
sss1 = _mm_packs_epi32(sss1, sss1);
sss2 = _mm_packs_epi32(sss2, sss2);
sss3 = _mm_packs_epi32(sss3, sss3);
lineOut0[xx] = _mm_cvtsi128_si32(_mm_packus_epi16(sss0, sss0));
lineOut1[xx] = _mm_cvtsi128_si32(_mm_packus_epi16(sss1, sss1));
lineOut2[xx] = _mm_cvtsi128_si32(_mm_packus_epi16(sss2, sss2));
lineOut3[xx] = _mm_cvtsi128_si32(_mm_packus_epi16(sss3, sss3));
}
#endif
}
}

Installation fails for amazonlinux Docker image on 2015 Macbook Pro

What did you do?

pip install pillow-simd

What did you expect to happen?

I am probably in over my skis here, but any help would be appreciated.

The installation itself is simple just as running $ pip install pillow-simd, and if you're using SSE4-capable CPU everything should run smoothly.

For what it is worth, on a separate build, pip install pillow succeeds.

What actually happened?

bash-4.2# pip install pillow-simd
Collecting pillow-simd
  Using cached Pillow-SIMD-4.3.0.post0.tar.gz
Requirement already satisfied: olefile in /usr/local/lib/python2.7/site-packages (from pillow-simd)
Building wheels for collected packages: pillow-simd
  Running setup.py bdist_wheel for pillow-simd ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AsgLv/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpeVNNmXpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/PIL
  copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/version.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  running egg_info
  writing requirements to Pillow_SIMD.egg-info/requires.txt
  writing Pillow_SIMD.egg-info/PKG-INFO
  writing top-level names to Pillow_SIMD.egg-info/top_level.txt
  writing dependency_links to Pillow_SIMD.egg-info/dependency_links.txt
  reading manifest file 'Pillow_SIMD.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_SIMD.egg-info/SOURCES.txt'
  copying PIL/.DS_Store -> build/lib.linux-x86_64-2.7/PIL
  running build_ext
  building 'PIL._imaging' extension
  creating build/temp.linux-x86_64-2.7/libImaging
  Building using 4 processes
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c outline.c -o build/temp.linux-x86_64-2.7/outline.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Bands.c -o build/temp.linux-x86_64-2.7/libImaging/Bands.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Convert.c -o build/temp.linux-x86_64-2.7/libImaging/Convert.o -msse4
  outline.c:20:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Bands.c:19:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Convert.c:36:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  compilation terminated.
  _imaging.c:74:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Dib.c -o build/temp.linux-x86_64-2.7/libImaging/Dib.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Fill.c -o build/temp.linux-x86_64-2.7/libImaging/Fill.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/GifDecode.c -o build/temp.linux-x86_64-2.7/libImaging/GifDecode.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/JpegEncode.c -o build/temp.linux-x86_64-2.7/libImaging/JpegEncode.o -msse4
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Dib.c:23:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Fill.c:19:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/JpegEncode.c:23:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/GifDecode.c:25:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Offset.c -o build/temp.linux-x86_64-2.7/libImaging/Offset.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Quant.c -o build/temp.linux-x86_64-2.7/libImaging/Quant.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/PcxDecode.c -o build/temp.linux-x86_64-2.7/libImaging/PcxDecode.o -msse4
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Offset.c:18:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/RawEncode.c -o build/temp.linux-x86_64-2.7/libImaging/RawEncode.o -msse4
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Quant.c:21:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/PcxDecode.c:17:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/RawEncode.c:21:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Unpack.c -o build/temp.linux-x86_64-2.7/libImaging/Unpack.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/ZipDecode.c -o build/temp.linux-x86_64-2.7/libImaging/ZipDecode.o -msse4
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/BoxBlur.c -o build/temp.linux-x86_64-2.7/libImaging/BoxBlur.o -msse4
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/Unpack.c:33:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  In file included from libImaging/Imaging.h:14:0,
                   from libImaging/ZipDecode.c:19:
  libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  libImaging/BoxBlur.c:1:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  gcc -pthread -shared build/temp.linux-x86_64-2.7/_imaging.o build/temp.linux-x86_64-2.7/decode.o build/temp.linux-x86_64-2.7/encode.o build/temp.linux-x86_64-2.7/map.o build/temp.linux-x86_64-2.7/display.o build/temp.linux-x86_64-2.7/outline.o build/temp.linux-x86_64-2.7/path.o build/temp.linux-x86_64-2.7/libImaging/Access.o build/temp.linux-x86_64-2.7/libImaging/AlphaComposite.o build/temp.linux-x86_64-2.7/libImaging/Resample.o build/temp.linux-x86_64-2.7/libImaging/Bands.o build/temp.linux-x86_64-2.7/libImaging/BcnDecode.o build/temp.linux-x86_64-2.7/libImaging/BitDecode.o build/temp.linux-x86_64-2.7/libImaging/Blend.o build/temp.linux-x86_64-2.7/libImaging/Chops.o build/temp.linux-x86_64-2.7/libImaging/Convert.o build/temp.linux-x86_64-2.7/libImaging/ConvertYCbCr.o build/temp.linux-x86_64-2.7/libImaging/Copy.o build/temp.linux-x86_64-2.7/libImaging/Crc32.o build/temp.linux-x86_64-2.7/libImaging/Crop.o build/temp.linux-x86_64-2.7/libImaging/Dib.o build/temp.linux-x86_64-2.7/libImaging/Draw.o build/temp.linux-x86_64-2.7/libImaging/Effects.o build/temp.linux-x86_64-2.7/libImaging/EpsEncode.o build/temp.linux-x86_64-2.7/libImaging/File.o build/temp.linux-x86_64-2.7/libImaging/Fill.o build/temp.linux-x86_64-2.7/libImaging/Filter.o build/temp.linux-x86_64-2.7/libImaging/FliDecode.o build/temp.linux-x86_64-2.7/libImaging/Geometry.o build/temp.linux-x86_64-2.7/libImaging/GetBBox.o build/temp.linux-x86_64-2.7/libImaging/GifDecode.o build/temp.linux-x86_64-2.7/libImaging/GifEncode.o build/temp.linux-x86_64-2.7/libImaging/HexDecode.o build/temp.linux-x86_64-2.7/libImaging/Histo.o build/temp.linux-x86_64-2.7/libImaging/JpegDecode.o build/temp.linux-x86_64-2.7/libImaging/JpegEncode.o build/temp.linux-x86_64-2.7/libImaging/LzwDecode.o build/temp.linux-x86_64-2.7/libImaging/Matrix.o build/temp.linux-x86_64-2.7/libImaging/ModeFilter.o build/temp.linux-x86_64-2.7/libImaging/Negative.o build/temp.linux-x86_64-2.7/libImaging/Offset.o build/temp.linux-x86_64-2.7/libImaging/Pack.o build/temp.linux-x86_64-2.7/libImaging/PackDecode.o build/temp.linux-x86_64-2.7/libImaging/Palette.o build/temp.linux-x86_64-2.7/libImaging/Paste.o build/temp.linux-x86_64-2.7/libImaging/Quant.o build/temp.linux-x86_64-2.7/libImaging/QuantOctree.o build/temp.linux-x86_64-2.7/libImaging/QuantHash.o build/temp.linux-x86_64-2.7/libImaging/QuantHeap.o build/temp.linux-x86_64-2.7/libImaging/PcdDecode.o build/temp.linux-x86_64-2.7/libImaging/PcxDecode.o build/temp.linux-x86_64-2.7/libImaging/PcxEncode.o build/temp.linux-x86_64-2.7/libImaging/Point.o build/temp.linux-x86_64-2.7/libImaging/RankFilter.o build/temp.linux-x86_64-2.7/libImaging/RawDecode.o build/temp.linux-x86_64-2.7/libImaging/RawEncode.o build/temp.linux-x86_64-2.7/libImaging/Storage.o build/temp.linux-x86_64-2.7/libImaging/SgiRleDecode.o build/temp.linux-x86_64-2.7/libImaging/SunRleDecode.o build/temp.linux-x86_64-2.7/libImaging/TgaRleDecode.o build/temp.linux-x86_64-2.7/libImaging/Unpack.o build/temp.linux-x86_64-2.7/libImaging/UnpackYCC.o build/temp.linux-x86_64-2.7/libImaging/UnsharpMask.o build/temp.linux-x86_64-2.7/libImaging/XbmDecode.o build/temp.linux-x86_64-2.7/libImaging/XbmEncode.o build/temp.linux-x86_64-2.7/libImaging/ZipDecode.o build/temp.linux-x86_64-2.7/libImaging/ZipEncode.o build/temp.linux-x86_64-2.7/libImaging/TiffDecode.o build/temp.linux-x86_64-2.7/libImaging/Jpeg2KDecode.o build/temp.linux-x86_64-2.7/libImaging/Jpeg2KEncode.o build/temp.linux-x86_64-2.7/libImaging/BoxBlur.o build/temp.linux-x86_64-2.7/libImaging/QuantPngQuant.o build/temp.linux-x86_64-2.7/libImaging/codec_fd.o -L/tmp/pip-build-8AsgLv/pillow-simd -L/usr/lib -L/lib64 -L/usr/lib64 -L/usr/local/lib -L/lib -L/usr/lib64 -ljpeg -lz -ltiff -lpython2.7 -o build/lib.linux-x86_64-2.7/PIL/_imaging.so
  gcc: error: build/temp.linux-x86_64-2.7/_imaging.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/decode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/encode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/map.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/display.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/outline.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/path.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Access.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/AlphaComposite.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Resample.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Bands.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/BcnDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/BitDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Blend.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Chops.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Convert.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/ConvertYCbCr.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Copy.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Crc32.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Crop.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Dib.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Draw.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Effects.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/EpsEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/File.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Fill.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Filter.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/FliDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Geometry.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/GetBBox.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/GifDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/GifEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/HexDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Histo.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/JpegDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/JpegEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/LzwDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Matrix.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/ModeFilter.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Negative.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Offset.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Pack.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/PackDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Palette.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Paste.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Quant.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantOctree.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantHash.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantHeap.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/PcdDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/PcxDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/PcxEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Point.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/RankFilter.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/RawDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/RawEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Storage.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/SgiRleDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/SunRleDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/TgaRleDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Unpack.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/UnpackYCC.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/UnsharpMask.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/XbmDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/XbmEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/ZipDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/ZipEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/TiffDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Jpeg2KDecode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/Jpeg2KEncode.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/BoxBlur.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantPngQuant.o: No such file or directory
  gcc: error: build/temp.linux-x86_64-2.7/libImaging/codec_fd.o: No such file or directory
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pillow-simd
  Running setup.py clean for pillow-simd
Failed to build pillow-simd
Installing collected packages: pillow-simd
  Running setup.py install for pillow-simd ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AsgLv/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xygH5C-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
    creating build/lib.linux-x86_64-2.7/PIL
    copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/version.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL
    copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
    running egg_info
    writing requirements to Pillow_SIMD.egg-info/requires.txt
    writing Pillow_SIMD.egg-info/PKG-INFO
    writing top-level names to Pillow_SIMD.egg-info/top_level.txt
    writing dependency_links to Pillow_SIMD.egg-info/dependency_links.txt
    reading manifest file 'Pillow_SIMD.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_SIMD.egg-info/SOURCES.txt'
    copying PIL/.DS_Store -> build/lib.linux-x86_64-2.7/PIL
    running build_ext
    building 'PIL._imaging' extension
    creating build/temp.linux-x86_64-2.7/libImaging
    Building using 4 processes
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c outline.c -o build/temp.linux-x86_64-2.7/outline.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Bands.c -o build/temp.linux-x86_64-2.7/libImaging/Bands.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Convert.c -o build/temp.linux-x86_64-2.7/libImaging/Convert.o -msse4
    outline.c:20:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    _imaging.c:74:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Bands.c:19:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Convert.c:36:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Dib.c -o build/temp.linux-x86_64-2.7/libImaging/Dib.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Fill.c -o build/temp.linux-x86_64-2.7/libImaging/Fill.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/GifDecode.c -o build/temp.linux-x86_64-2.7/libImaging/GifDecode.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Dib.c:23:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/JpegEncode.c -o build/temp.linux-x86_64-2.7/libImaging/JpegEncode.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Fill.c:19:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/GifDecode.c:25:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Offset.c -o build/temp.linux-x86_64-2.7/libImaging/Offset.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/JpegEncode.c:23:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Offset.c:18:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Quant.c -o build/temp.linux-x86_64-2.7/libImaging/Quant.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/PcxDecode.c -o build/temp.linux-x86_64-2.7/libImaging/PcxDecode.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Quant.c:21:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/RawEncode.c -o build/temp.linux-x86_64-2.7/libImaging/RawEncode.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/PcxDecode.c:17:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/Unpack.c -o build/temp.linux-x86_64-2.7/libImaging/Unpack.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/RawEncode.c:21:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/Unpack.c:33:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/ZipDecode.c -o build/temp.linux-x86_64-2.7/libImaging/ZipDecode.o -msse4
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DPILLOW_VERSION="4.3.0.post0" -I/usr/include/freetype2 -I/tmp/pip-build-8AsgLv/pillow-simd/libImaging -I/tmp/pip-build-8AsgLv/pillow-simd -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c libImaging/BoxBlur.c -o build/temp.linux-x86_64-2.7/libImaging/BoxBlur.o -msse4
    In file included from libImaging/Imaging.h:14:0,
                     from libImaging/ZipDecode.c:19:
    libImaging/ImPlatform.h:10:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    libImaging/BoxBlur.c:1:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    gcc -pthread -shared build/temp.linux-x86_64-2.7/_imaging.o build/temp.linux-x86_64-2.7/decode.o build/temp.linux-x86_64-2.7/encode.o build/temp.linux-x86_64-2.7/map.o build/temp.linux-x86_64-2.7/display.o build/temp.linux-x86_64-2.7/outline.o build/temp.linux-x86_64-2.7/path.o build/temp.linux-x86_64-2.7/libImaging/Access.o build/temp.linux-x86_64-2.7/libImaging/AlphaComposite.o build/temp.linux-x86_64-2.7/libImaging/Resample.o build/temp.linux-x86_64-2.7/libImaging/Bands.o build/temp.linux-x86_64-2.7/libImaging/BcnDecode.o build/temp.linux-x86_64-2.7/libImaging/BitDecode.o build/temp.linux-x86_64-2.7/libImaging/Blend.o build/temp.linux-x86_64-2.7/libImaging/Chops.o build/temp.linux-x86_64-2.7/libImaging/Convert.o build/temp.linux-x86_64-2.7/libImaging/ConvertYCbCr.o build/temp.linux-x86_64-2.7/libImaging/Copy.o build/temp.linux-x86_64-2.7/libImaging/Crc32.o build/temp.linux-x86_64-2.7/libImaging/Crop.o build/temp.linux-x86_64-2.7/libImaging/Dib.o build/temp.linux-x86_64-2.7/libImaging/Draw.o build/temp.linux-x86_64-2.7/libImaging/Effects.o build/temp.linux-x86_64-2.7/libImaging/EpsEncode.o build/temp.linux-x86_64-2.7/libImaging/File.o build/temp.linux-x86_64-2.7/libImaging/Fill.o build/temp.linux-x86_64-2.7/libImaging/Filter.o build/temp.linux-x86_64-2.7/libImaging/FliDecode.o build/temp.linux-x86_64-2.7/libImaging/Geometry.o build/temp.linux-x86_64-2.7/libImaging/GetBBox.o build/temp.linux-x86_64-2.7/libImaging/GifDecode.o build/temp.linux-x86_64-2.7/libImaging/GifEncode.o build/temp.linux-x86_64-2.7/libImaging/HexDecode.o build/temp.linux-x86_64-2.7/libImaging/Histo.o build/temp.linux-x86_64-2.7/libImaging/JpegDecode.o build/temp.linux-x86_64-2.7/libImaging/JpegEncode.o build/temp.linux-x86_64-2.7/libImaging/LzwDecode.o build/temp.linux-x86_64-2.7/libImaging/Matrix.o build/temp.linux-x86_64-2.7/libImaging/ModeFilter.o build/temp.linux-x86_64-2.7/libImaging/Negative.o build/temp.linux-x86_64-2.7/libImaging/Offset.o build/temp.linux-x86_64-2.7/libImaging/Pack.o build/temp.linux-x86_64-2.7/libImaging/PackDecode.o build/temp.linux-x86_64-2.7/libImaging/Palette.o build/temp.linux-x86_64-2.7/libImaging/Paste.o build/temp.linux-x86_64-2.7/libImaging/Quant.o build/temp.linux-x86_64-2.7/libImaging/QuantOctree.o build/temp.linux-x86_64-2.7/libImaging/QuantHash.o build/temp.linux-x86_64-2.7/libImaging/QuantHeap.o build/temp.linux-x86_64-2.7/libImaging/PcdDecode.o build/temp.linux-x86_64-2.7/libImaging/PcxDecode.o build/temp.linux-x86_64-2.7/libImaging/PcxEncode.o build/temp.linux-x86_64-2.7/libImaging/Point.o build/temp.linux-x86_64-2.7/libImaging/RankFilter.o build/temp.linux-x86_64-2.7/libImaging/RawDecode.o build/temp.linux-x86_64-2.7/libImaging/RawEncode.o build/temp.linux-x86_64-2.7/libImaging/Storage.o build/temp.linux-x86_64-2.7/libImaging/SgiRleDecode.o build/temp.linux-x86_64-2.7/libImaging/SunRleDecode.o build/temp.linux-x86_64-2.7/libImaging/TgaRleDecode.o build/temp.linux-x86_64-2.7/libImaging/Unpack.o build/temp.linux-x86_64-2.7/libImaging/UnpackYCC.o build/temp.linux-x86_64-2.7/libImaging/UnsharpMask.o build/temp.linux-x86_64-2.7/libImaging/XbmDecode.o build/temp.linux-x86_64-2.7/libImaging/XbmEncode.o build/temp.linux-x86_64-2.7/libImaging/ZipDecode.o build/temp.linux-x86_64-2.7/libImaging/ZipEncode.o build/temp.linux-x86_64-2.7/libImaging/TiffDecode.o build/temp.linux-x86_64-2.7/libImaging/Jpeg2KDecode.o build/temp.linux-x86_64-2.7/libImaging/Jpeg2KEncode.o build/temp.linux-x86_64-2.7/libImaging/BoxBlur.o build/temp.linux-x86_64-2.7/libImaging/QuantPngQuant.o build/temp.linux-x86_64-2.7/libImaging/codec_fd.o -L/tmp/pip-build-8AsgLv/pillow-simd -L/usr/lib -L/lib64 -L/usr/lib64 -L/usr/local/lib -L/lib -L/usr/lib64 -ljpeg -lz -ltiff -lpython2.7 -o build/lib.linux-x86_64-2.7/PIL/_imaging.so
    gcc: error: build/temp.linux-x86_64-2.7/_imaging.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/decode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/encode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/map.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/display.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/outline.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/path.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Access.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/AlphaComposite.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Resample.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Bands.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/BcnDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/BitDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Blend.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Chops.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Convert.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/ConvertYCbCr.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Copy.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Crc32.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Crop.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Dib.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Draw.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Effects.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/EpsEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/File.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Fill.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Filter.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/FliDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Geometry.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/GetBBox.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/GifDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/GifEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/HexDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Histo.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/JpegDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/JpegEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/LzwDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Matrix.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/ModeFilter.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Negative.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Offset.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Pack.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/PackDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Palette.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Paste.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Quant.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantOctree.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantHash.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantHeap.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/PcdDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/PcxDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/PcxEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Point.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/RankFilter.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/RawDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/RawEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Storage.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/SgiRleDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/SunRleDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/TgaRleDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Unpack.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/UnpackYCC.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/UnsharpMask.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/XbmDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/XbmEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/ZipDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/ZipEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/TiffDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Jpeg2KDecode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/Jpeg2KEncode.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/BoxBlur.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/QuantPngQuant.o: No such file or directory
    gcc: error: build/temp.linux-x86_64-2.7/libImaging/codec_fd.o: No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8AsgLv/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xygH5C-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8AsgLv/pillow-simd/

What versions of Pillow and Python are you using?

Python 2.7 inside Amazon Linux image

Dockerfile

FROM amazonlinux:latest

RUN yum -y update && \
    yum -y groupinstall "Development Tools" && \
    yum -y install python-dev python-setuptools \
                   libtiff-devel \
                   libjpeg-devel \
                   zlib-devel \
                   freetype-devel \
                   lcms2-devel \
                   libwebp-devel \
                   tcl-devel \
                   tk-devel \
                   libraqm-devel \
                   libimagequant-devel \
                   zip

RUN curl -O https://bootstrap.pypa.io/get-pip.py && python get-pip.py
RUN pip install pillow-simd

libImaging as C functions ?

Is there a simple way to use libImaging as C functions in a c program. I mainly interested in those
functions.
I mainly interested in the ImageStretch Function like here

https://github.com/python-pillow/Pillow/blob/2.6.2/_imaging.c#L1635

static PyObject*
_stretch(ImagingObject* self, PyObject* args)
{
Imaging imIn;
Imaging imTemp;
Imaging imOut;

int xsize, ysize;
int filter = IMAGING_TRANSFORM_NEAREST;
if (!PyArg_ParseTuple(args, "(ii)|i", &xsize, &ysize, &filter))
return NULL;

imIn = self->image;

/* two-pass resize: minimize size of intermediate image */
if ((Py_ssize_t) imIn->xsize * ysize < (Py_ssize_t) xsize * imIn->ysize)
    imTemp = ImagingNew(imIn->mode, imIn->xsize, ysize);
else
    imTemp = ImagingNew(imIn->mode, xsize, imIn->ysize);
if (!imTemp)
    return NULL;

/* first pass */
if (!ImagingStretch(imTemp, imIn, filter)) {
    ImagingDelete(imTemp);
    return NULL;
}

imOut = ImagingNew(imIn->mode, xsize, ysize);
if (!imOut) {
    ImagingDelete(imTemp);
    return NULL;
}

/* second pass */
if (!ImagingStretch(imOut, imTemp, filter)) {
    ImagingDelete(imOut);
    ImagingDelete(imTemp);
    return NULL;

}

because in https://github.com/python-pillow/Pillow/blob/master/src/libImaging/Imaging.h is defined and i want to know how to fill right the instance of imIn. Are there any load functions which i can use in a c/c++ programm or something like that. A simple C/C++ Interface would be nice.

Does this support python 3.7?

I got an error when I build.

Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-razmn4fa/pillow-simd/setup.py", line 793, in <module>
      zip_safe=not (debug_build() or PLATFORM_MINGW), )
    File "/home/xddz/anaconda3/envs/pytorch/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/home/xddz/anaconda3/envs/pytorch/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/xddz/anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/home/xddz/anaconda3/envs/pytorch/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/home/xddz/anaconda3/envs/pytorch/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 230, in run
      impl_tag, abi_tag, plat_tag = self.get_tag()
    File "/home/xddz/anaconda3/envs/pytorch/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 179, in get_tag
      assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0])
  AssertionError: ('cp37', 'cp@pyvernodots@m', 'linux_x86_64') != ('cp37', 'cp@PYVERNODOTS@m', 'linux_x86_64')
  ----------------------------------------
  ERROR: Failed building wheel for pillow-simd

TIFF input is broken (OSError: image file is truncated)

What did you do?

import PIL.Image as Image

with open('image.tiff', 'rb') as f:
    i = Image.open(f)
    i.load()

What did you expect to happen?

Image is loaded normally

What actually happened?

Traceback (most recent call last):
  File "example.py", line 5, in <module>
    i.load()
  File "/usr/local/lib/python3.6/site-packages/PIL/TiffImagePlugin.py", line 1053, in load
    return super(TiffImageFile, self).load()
  File "/usr/local/lib/python3.6/site-packages/PIL/ImageFile.py", line 233, in load
    "(%d bytes not processed)" % len(b))
OSError: image file is truncated (763 bytes not processed)

What versions of Pillow and Python are you using?

$ python3 --version
Python 3.6.3

$ pip3 freeze | grep -i pil
Pillow-SIMD==4.3.0.post0

The affected image file (gzipped):

image.tiff.gz
The image is accepted just fine by ImageMagick and pretty much everything else

failed to compile on osx 10.13.1

What did you do?

pip install pillow-simd

What did you expect to happen?

installation successful!

What actually happened?

gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/_imaging.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/decode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/encode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/map.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/display.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/outline.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/path.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Access.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/AlphaComposite.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Resample.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Bands.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/BcnDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/BitDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Blend.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Chops.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Convert.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/ConvertYCbCr.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Copy.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Crc32.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Crop.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Dib.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Draw.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Effects.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/EpsEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/File.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Fill.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Filter.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/FliDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Geometry.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/GetBBox.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/GifDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/GifEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/HexDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Histo.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/JpegDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/JpegEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/LzwDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Matrix.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/ModeFilter.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Negative.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Offset.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Pack.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/PackDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Palette.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Paste.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Quant.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/QuantOctree.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/QuantHash.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/QuantHeap.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/PcdDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/PcxDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/PcxEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Point.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/RankFilter.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/RawDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/RawEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Storage.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/SgiRleDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/SunRleDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/TgaRleDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Unpack.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/UnpackYCC.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/UnsharpMask.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/XbmDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/XbmEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/ZipDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/ZipEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/TiffDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Jpeg2KDecode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/Jpeg2KEncode.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/BoxBlur.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/QuantPngQuant.o: No such file or directory
    gcc-7: error: build/temp.macosx-10.7-x86_64-3.6/libImaging/codec_fd.o: No such file or directory
    error: command '/usr/local/bin/gcc-7' failed with exit status 1

    ----------------------------------------
Command "/Users/jm/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/8z/6gyqrw911r709263p3pl1p_40000gp/T/pip-build-5qt99j_0/pillow-simd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/8z/6gyqrw911r709263p3pl1p_40000gp/T/pip-n8bt_d91-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/8z/6gyqrw911r709263p3pl1p_40000gp/T/pip-build-5qt99j_0/pillow-simd/

What versions of Pillow and Python are you using?

python 3.6.3
previous pillow installation: None.

`img.convert(RGB)` cuases OSError

What did you do?

I tried to convert images in https://tiny-imagenet.herokuapp.com/ to RGB as the following code.

base = pathlib.Path("tinyimagenet/train")
for d in base.iterdir():
    for i in d.glob("*.JPEG"):
         with open(i, 'rb') as f:
             try:
                 Image.open(f).convert("RGB")
             except OSError:
                 print(f"error: {i}")

What did you expect to happen?

The same code causes no error on pure Pillow and I didn't expect any trouble.

What actually happened?

Not all but many images caused OSError broken data stream when reading image file.

What are your OS, Python and Pillow versions?

On using .postX to distinguish Pillow-SIMD from Pillow at run-time

In README you say:

"Pillow-SIMD is "following" Pillow. Pillow-SIMD versions are 100% compatible drop-in replacements for Pillow of the same version. For example, Pillow-SIMD 3.2.0.post3 is a drop-in replacement for Pillow 3.2.0, and Pillow-SIMD 3.3.3.post0 — for Pillow 3.3.3."

I see plenty of .postX releases for Pillow: https://github.com/python-pillow/Pillow/releases, so I'm not sure how that strategy is working out in practice.

Perhaps there should be a more reliable way to tell Pillow-SIMD is used when PIL is loaded? Some kind of special symbol that's only defined in Pillow-SIMD?

Animated WebP not supported

It looks like pillow-simd doesn't support animated WebP since it's WebPImagePlugin.py is behind upstream's. It would be awesome to get this into pillow-simd.

A problem with opening an image with webp format in v5.1.1.post0

What did you do?

I tried to open an image in webp format:
https://drive.google.com/open?id=10_2biIHzTtepo3Y9C78x6er-8Y2-XXzU

What actually happened?

I got an error on MacOS and on travis' server. But it works as expected on my Ubuntu 16.04. Also it is not an issue for v4.3.0.post0.

What versions of Pillow and Python are you using?

Python 3.6.2, 3.6.3, 3.6.4, Pillow-SIMD==5.1.1.post0

from io import BytesIO
from path import Path

from PIL import Image

image_file = Path('api_assets_test.webp')

with image_file.open(mode='rb') as fp:
    image = Image.open(BytesIO(fp.read()))

resultes with OSError

fp = <_io.BytesIO object at 0x7f1d8d411f10>, mode = 'r'
    def open(fp, mode="r"):
        """
        Opens and identifies the given image file.
    
        This is a lazy operation; this function identifies the file, but
        the file remains open and the actual image data is not read from
        the file until you try to process the data (or call the
        :py:meth:`~PIL.Image.Image.load` method).  See
        :py:func:`~PIL.Image.new`.
    
        :param fp: A filename (string), pathlib.Path object or a file object.
           The file object must implement :py:meth:`~file.read`,
           :py:meth:`~file.seek`, and :py:meth:`~file.tell` methods,
           and be opened in binary mode.
        :param mode: The mode.  If given, this argument must be "r".
        :returns: An :py:class:`~PIL.Image.Image` object.
        :exception IOError: If the file cannot be found, or the image cannot be
           opened and identified.
        """
    
        if mode != "r":
            raise ValueError("bad mode %r" % mode)
    
        exclusive_fp = False
        filename = ""
        if isPath(fp):
            filename = fp
        elif HAS_PATHLIB and isinstance(fp, Path):
            filename = str(fp.resolve())
    
        if filename:
            fp = builtins.open(filename, "rb")
            exclusive_fp = True
    
        try:
            fp.seek(0)
        except (AttributeError, io.UnsupportedOperation):
            fp = io.BytesIO(fp.read())
            exclusive_fp = True
    
        prefix = fp.read(16)
    
        preinit()
    
        def _open_core(fp, filename, prefix):
            for i in ID:
                try:
                    factory, accept = OPEN[i]
                    if not accept or accept(prefix):
                        fp.seek(0)
                        im = factory(fp, filename)
                        _decompression_bomb_check(im.size)
                        return im
                except (SyntaxError, IndexError, TypeError, struct.error):
                    # Leave disabled by default, spams the logs with image
                    # opening failures that are entirely expected.
                    # logger.debug("", exc_info=True)
                    continue
            return None
    
        im = _open_core(fp, filename, prefix)
    
        if im is None:
            if init():
                im = _open_core(fp, filename, prefix)
    
        if im:
            im._exclusive_fp = exclusive_fp
            return im
    
        if exclusive_fp:
            fp.close()
        raise IOError("cannot identify image file %r"
>                     % (filename if filename else fp))
E       OSError: cannot identify image file <_io.BytesIO object at 0x7f1d8d411f10>

Benchmark details?

It would be nice to know at least the command or code used to produce the benchmark, in order to be able to run the same on our own hardware. Some ImageMagick and PIL methods are faster than others, so we don't really know what's being compared, as it stands.

Using Pillow-simd and setup.py

I am using Pillow-simd and it does provide a general speedup.
However, I use packages that have specified pillow in their dependency managements (install_requires).
This means that every time I install or update such a package, pillow gets installed and overwrites pillow-simd.

Is there a way to counter that, or something you can change in the setup.py directive?
The only alternative I can see, is that people remove pillow from there install_requires list, but I don't think maintainers would want to do that...

Clarification: would it be safe to recommend pillow-simd?

Hi,

Author of imgp here. I came across pillow-simd while looking for a performance benchmark of ImageMagick against Pillow. I could see that pillow-simd gains much more over stock pillow and would love to recommend pillow-simd for imgp.

I have run my tests with 2000 images and found no issues with pillow-simd as the backend to imgp. So thought of confirming with you as well.

imgp uses the multiprocessing module and converts one image per core with a global lock in place to print informative messages to stdout. Do you see any issue with using pillow-simd?

Resize generate black band on image

What did you do?

Just resize a image with a particular size

What did you expect to happen?

Don't add black band on image

What actually happened?

Add a black band on image

What are your OS, Python and Pillow versions?

  • OS: ubuntu 18.04
  • Python: 2.7 and 3.7
  • Pillow-simd: 5.3.0.post0

This code work well with pillow, but with pillow-simd the black band appear.
Also if i change size works well, i don't understand why only with this image and this size.
I tried to replicate the thumbnail function without usate draft function, and works well, i don't know if this help to investigate.

from PIL import Image
img = Image.open('original.jpg')
img.thumbnail((170,170), 1)
img.save('pillow-simd-converted.jpg')

Original image
original

Pillow-simd converted
pillow-simd-converted

Maybe should add additional functionality saving aspect ratio for resizing method.

Should add additional functionality saving aspect ratio for resizing method.

Something like this
`

def resize(self, size, resample=NEAREST, box=None, save_ratio=False):
    if save_ratio:
        ratio_width = float(size[0] / float(self.im.width))
        ratio_height = float(size[1] / float(self.im.height))

        ratio = min(ratio_height, ratio_width)

        width = int(float(self.im.width) * ratio)
        height = int(float(self.im.height) * ratio)

        size = (width, height)   

`

AVX support for older CPUs

Do we have plans to support older CPUs that have AVX but not AVX2? For example, Sandy Bridge era XEON CPUs circa 2011.

AVX2 version failed on non AVX2 CPU

What did you do?

Run
CC="cc -mavx2" pip install -U --force-reinstall pillow-simd
on avx CPU, not avx2

What did you expect to happen?

to be installed ignoring this flag or gracefully failover

What actually happened?

it was installed but any call of the library crashes with 142 Illegal instruction (core dumped) python3

What versions of Pillow and Python are you using?

4.3post, Python 3.6.3, Alpine docker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.