--- Pillow-4.2.1/mp_compile.py.orig 2017-08-18 16:27:09.000000000 +0100 +++ Pillow-4.2.1/mp_compile.py 2017-08-18 23:34:17.226557000 +0100 @@ -2,7 +2,7 @@ import os import sys from distutils.ccompiler import CCompiler -from multiprocessing import Pool, cpu_count +from multiprocessing import Pool, cpu_count, freeze_support try: MAX_PROCS = int(os.environ.get("MAX_CONCURRENCY", min(4, cpu_count()))) @@ -38,7 +38,9 @@ output_dir, macros, include_dirs, sources, depends, extra_postargs) cc_args = self._get_cc_args(pp_opts, debug, extra_preargs) - pool = Pool(MAX_PROCS) + if __name__ == '__main__': + freeze_support() + pool = Pool(MAX_PROCS) try: print("Building using %d processes" % pool._processes) except: