Skip to content

Installation issues on Windows/Python 3.7 #2842

Description

@Mattwmaster58

What did you do?

Admin CMD console > python -m pip install pillow --trusted-host='pypi.python.org'

What versions of Pillow and Python are you using?

Python Version 3.7, latest pip
Latest Pillow version (4.3?)
Windows 10 Pro

I think the most relevant part from this error is this part:

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

and yet typing import zlib into the python console produces no errors.
Is it b/c the Appdata dir is c:\users\marcus family\appdata\local\ half the time and the other times it's C:\Users\MARCUS~1\AppData\Local\?

Here is the full output from python -m pip install pillow --trusted-host='pypi.python.org"

Here is the full output from this command Collecting pillow Downloading Pillow-4.3.0.tar.gz (13.9MB) 100% |████████████████████████████████| 13.9MB 7.9MB/s Requirement already satisfied: olefile in c:\users\marcus family\appdata\local\programs\python\python37\lib\site-packages (from pillow) Installing collected packages: pillow Running setup.py install for pillow ... error Complete output from command "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\MARCUS~1\\AppData\\Local\\Temp\\pip-build-9mcv5007\\pillow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\MARCUS~1\AppData\Local\Temp\pip-au15nuhi-record\install-record.txt --single-version-externally-managed --compile: Single threaded build for windows running install running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\PIL copying PIL\BdfFontFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\BmpImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\ContainerIO.py -> build\lib.win-amd64-3.7\PIL copying PIL\CurImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\DcxImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\DdsImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\EpsImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\ExifTags.py -> build\lib.win-amd64-3.7\PIL copying PIL\features.py -> build\lib.win-amd64-3.7\PIL copying PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\FliImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\FontFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\FpxImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\FtexImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\GbrImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\GdImageFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\GifImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\GimpGradientFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\GimpPaletteFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\GribStubImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\IcnsImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\IcoImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\Image.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageChops.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageCms.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageColor.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageDraw.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageDraw2.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageEnhance.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageFilter.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageFont.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageGrab.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageMath.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageMode.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageMorph.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageOps.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImagePalette.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImagePath.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageQt.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageSequence.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageShow.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageStat.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageTk.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageTransform.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImageWin.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\ImtImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\IptcImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\JpegImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\JpegPresets.py -> build\lib.win-amd64-3.7\PIL copying PIL\McIdasImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\MicImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\MpegImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\MpoImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\MspImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\OleFileIO.py -> build\lib.win-amd64-3.7\PIL copying PIL\PaletteFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\PalmImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PcdImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PcfFontFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\PcxImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PdfImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PixarImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PngImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PpmImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PsdImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\PSDraw.py -> build\lib.win-amd64-3.7\PIL copying PIL\PyAccess.py -> build\lib.win-amd64-3.7\PIL copying PIL\SgiImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\SpiderImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\SunImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\TarIO.py -> build\lib.win-amd64-3.7\PIL copying PIL\TgaImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\TiffTags.py -> build\lib.win-amd64-3.7\PIL copying PIL\version.py -> build\lib.win-amd64-3.7\PIL copying PIL\WalImageFile.py -> build\lib.win-amd64-3.7\PIL copying PIL\WebPImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-3.7\PIL copying PIL\_binary.py -> build\lib.win-amd64-3.7\PIL copying PIL\_tkinter_finder.py -> build\lib.win-amd64-3.7\PIL copying PIL\_util.py -> build\lib.win-amd64-3.7\PIL copying PIL\__init__.py -> build\lib.win-amd64-3.7\PIL running egg_info writing Pillow.egg-info\PKG-INFO writing dependency_links to Pillow.egg-info\dependency_links.txt writing requirements to Pillow.egg-info\requires.txt writing top-level names to Pillow.egg-info\top_level.txt reading manifest file 'Pillow.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*.sh' no previously-included directories found matching 'docs\_static' warning: no previously-included files found matching '.coveragerc' warning: no previously-included files found matching 'codecov.yml' warning: no previously-included files found matching '.editorconfig' warning: no previously-included files found matching '.landscape.yaml' warning: no previously-included files found matching '.travis' warning: no previously-included files found matching '.travis\*' warning: no previously-included files found matching 'appveyor.yml' warning: no previously-included files found matching 'build_children.sh' warning: no previously-included files found matching 'tox.ini' warning: no previously-included files matching '.git*' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution writing manifest file 'Pillow.egg-info\SOURCES.txt' running build_ext
The headers or library files could not be found for 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 "C:\Users\MARCUS~1\AppData\Local\Temp\pip-build-9mcv5007\pillow\setup.py", line 787, in <module>
    zip_safe=not (debug_build() or PLATFORM_MINGW), )
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 339, in run
    self.build_extensions()
  File "C:\Users\MARCUS~1\AppData\Local\Temp\pip-build-9mcv5007\pillow\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 "C:\Users\MARCUS~1\AppData\Local\Temp\pip-build-9mcv5007\pillow\setup.py", line 799, 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 ""C:\Users\Marcus Family\AppData\Local\Programs\Python\Python37\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\MARCUS1\AppData\Local\Temp\pip-build-9mcv5007\pillow\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\MARCUS1\AppData\Local\Temp\pip-au15nuhi-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\MARCUS~1\AppData\Local\Temp\pip-build-9mcv5007\pillow</code>

PS sorry about the code formatting — It was that or no spoiler

Activity

  1. hugovk commented on Nov 8, 2017

    @hugovk
    Member

    We don't yet officially support unreleased Python 3.7.

    Because pip can't find a binary wheel for 3.7, it's downloading the source and trying to build it, which on Windows is a pain.

    I suggest downloading the wheel for Python 3.6 and pip installing from that.

  2. hugovk commented on Nov 8, 2017

    @hugovk
    Member

    The same thing came up for Python 3.6: #2318 and a few times on Stack Overflow, and will come up again.

    Python 3.7 is still in alpha but due out on 2018-06-15:
    https://www.python.org/dev/peps/pep-0537/#schedule

    We'll most likely have wheels for Python 3.7 in our 2018-07-01 release (probably Pillow 4.6.0 5.2.0).

    Before that, should we print out a warning for Python 3.7 on Windows that it's not yet supported and suggesting to use the 3.6 wheel? (And when 3.7 is supported, ++ each version.)

  3. Mattwmaster58 commented on Nov 8, 2017

    @Mattwmaster58
    Author

    Before that, should we print out a warning for Python 3.7 on Windows that it's not yet supported and suggesting to use the 3.6 wheel?

    That would be helpful. I'll try the 3.6 wheel later today.

  4. changed the title [-]Installation issues on Windows[/-] [+]Installation issues on Windows/Python 3.7[/+] on Nov 9, 2017
  5. Mattwmaster58 commented on Nov 9, 2017

    @Mattwmaster58
    Author

    Manually downloading the all variants of the 3.6 wheel have all rendered the same error message:
    Pillow-4.3.0-[version specifc info].whl is not a supported wheel on this platform.

    I go back to Python 3.6, I just like the bleeding edge (;

  6. hugovk commented on Nov 14, 2017

    @hugovk
    Member

    #2855 is a PR to warn 3.7 isn't yet supported on Windows.

    By the way, you may be able to install the 3.6 wheel on 3.7 by renaming it from Pillow-4.3.0-cp36-cp36m-win32.whl to something like Pillow-4.3.0-cp37-cp37m-win32.whl (https://stackoverflow.com/a/28111899/724176).

  7. cfleveratto commented on Nov 16, 2017

    @cfleveratto

    I'm getting the same error for Pillow version 4.3.0 and python version 3.6.3 with final error of

    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yuztoa48/Pillow/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-3lhc0a5r-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-yuztoa48/Pillow/
    
  8. hugovk commented on Nov 16, 2017

    @hugovk
    Member

    @cfleveratto That doesn't look like Windows or Python 3.7. Please open a new issue with more detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions