Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Install of Pillow fails
#1
I'm trying to install PIL / Pillow.
Running on Win 7.
I have tried with both Pythin 2.7 and 3.3 (which are both installed)

I typed pip install Pillow in CMD window in the \Pythonxx directory

In both cases much the same thing happened with a bunch of missing files after reading the manifest; and then a message about missing library zlib.
Fill cmd window output pasted below.

I have to say I find the whole approach in Python to installation to be very user-unfriendly (I have installed some other packages Ok like python-Levenshtein etc but its a lot of black magic and mumbo jumbo.

All I need PIL for right now is to extract JPG image dimensions form JPG files. I did find a python script that calins to do it directly but it doesnt seem tbe able to read the JPG files exported from LIghtroom successfully.

.....

CMD window output:
running build_py
creating build
creating build\lib.win-amd64-3.3
creating build\lib.win-amd64-3.3\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ContainerIO.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ExifTags.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\features.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\FontFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\GdImageFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\Image.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageChops.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageCms.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageColor.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageDraw.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageFilter.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageFont.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageGrab.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageMath.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageMode.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageMorph.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageOps.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImagePalette.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImagePath.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageQt.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageSequence.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageShow.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageStat.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageTk.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageTransform.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImageWin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\JpegPresets.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\OleFileIO.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PaletteFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PdfParser.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PSDraw.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\PyAccess.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\TarIO.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\TiffTags.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\WalImageFile.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\_binary.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\_tkinter_finder.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\_util.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\_version.py -> build\lib.win-amd64-3.3\PIL
copying src\PIL\__init__.py -> build\lib.win-amd64-3.3\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
c:\python33\lib\distutils\dist.py:257: UserWarning: Unknown distribution optio
n: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found

reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
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 '.readthedocs.yml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis\*'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distr
ibution
warning: no previously-included files matching '*.pyc' found anywhere in distr
ibution
warning: no previously-included files matching '*.so' found anywhere in distri
bution
writing manifest file 'src\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/...ation.html

Traceback (most recent call last):
File "c:\users\richard\appdata\local\temp\pip-build-zenom_\Pillow\setup.py",
line 800, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW), )
File "c:\python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python33\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
File "c:\python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "c:\python33\lib\site-packages\wheel\bdist_wheel.py", line 176, in run
self.run_command('build')
File "c:\python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "c:\python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "c:\python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "c:\python33\lib\distutils\command\build_ext.py", line 347, in run
self.build_extensions()
File "c:\users\richard\appdata\local\temp\pip-build-zenom_\Pillow\setup.py",
line 612, 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\richard\appdata\local\temp\pip-build-zenom_\Pillow\setup.py",
line 812, 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/...ation.html



----------------------------------------
Failed building wheel for Pillow
Failed to build Pillow
Installing collected packages: Pillow
Running setup.py install for Pillow
Complete output from command c:\python33\python.exe -c "import setuptools, t
okenize;__file__='c:\\users\\richard\\appdata\\local\\temp\\pip-build-zenom_\\Pi
llow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().re
place('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\richard\appda
ta\local\temp\pip-tjfhn2-record\install-record.txt --single-version-externally-m
anaged --compile:
Single threaded build for Windows
running install
running build
running build_py
running egg_info
writing top-level names to src\Pillow.egg-info\top_level.txt
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
c:\python33\lib\distutils\dist.py:257: UserWarning: Unknown distribution opt
ion: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found

reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
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 '.readthedocs.yml'
warning: no previously-included files found matching '.travis'
warning: no previously-included files found matching '.travis\*'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in dis
tribution
warning: no previously-included files matching '*.pyc' found anywhere in dis
tribution
warning: no previously-included files matching '*.so' found anywhere in dist
ribution
writing manifest file 'src\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/...ation.html

Traceback (most recent call last):
File "c:\users\richard\appdata\local\temp\pip-build-zenom_\Pillow\setup.py
", line 800, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW), )
File "c:\python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python33\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
File "c:\python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "c:\python33\lib\site-packages\setuptools-18.4-py3.3.egg\setuptools\c
ommand\install.py", line 61, in run
File "c:\python33\lib\distutils\command\install.py", line 569, in run
self.run_command('build')
File "c:\python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "c:\python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "c:\python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "c:\python33\lib\distutils\command\build_ext.py", line 347, in run
self.build_extensions()
File "c:\users\richard\appdata\local\temp\pip-build-zenom_\Pillow\setup.py
", line 612, 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\richard\appdata\local\temp\pip-build-zenom_\Pillow\setup.py
", line 812, 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/...ation.html



----------------------------------------
Command "c:\python33\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\richard\\appdata\\local\\temp\\pip-build-zenom_\\Pillow\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\richard\appdata\local\temp\pip-tjfhn2
-record\install-record.txt --single-version-externally-managed --compile" failed
with error code 1 in c:\users\richard\appdata\local\temp\pip-build-zenom_\Pillo
w
You are using pip version 7.1.2, however version 19.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

C:\Python27>DLLs^A

C:\Python27>
Quote
#2
Do not use 2.7 or 3.3.
Python 3.6/3.7 and pip installation under Windows.
Install Python 3.7.
Then it should work as this.
# Test that pip work
C:\code
λ pip -V
pip 19.0.1 from c:\python37\lib\site-packages\pip (python 3.7)

# install Pillow
C:\code
λ pip install Pillow
Collecting Pillow
  Downloading https://files.pythonhosted.org/packages/d7/ea/4../Pillow-5.4.1-cp37-cp37m-win32.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 694kB/s
Installing collected packages: Pillow
Successfully installed Pillow-5.4.1

# Test that it work
C:\code
λ python
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> Image.__version__
'5.4.1'
>>>
Quote
#3
Thanks, I will try this. I wasn’t aware it was so finicky on versions.

[On a philosophical aside I do find it somewhat awkward that I seem to need multiple versions of Python. Maybe I can move my 3.3 scripts to 3.7 but I would not be shocked to find something breaks somewhere. At least I have plenty of disk space haha]
Quote
#4
With a few false starts and some blind fiddling this now works. Thank you!

I did have to brute force edit the system path to get it to "see" PIL and also fudge IDLE to run Python37. Is there a good tutorial on how to manage multiple Python versions? Ideally Id like a batch file or something that I can run 'SetPython 37' Or 27 or 33 as the case may be.
Quote
#5
(Jan-28-2019, 06:10 AM)RMJFlack Wrote: Is there a good tutorial on how to manage multiple Python versions?
I do have it link i posted under Access other versions.
When install Python 3.7 it also install py.exe in windows folder.
py can be used to access all Python version installed.
G:\
λ py -3.4 -V
Python 3.4.2

G:\
λ py -2.7 -V
Python 2.7.9


# So running a file with Python 2 would be
λ py -2.7 version.py
Hello from 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]

G:\
λ py -3.5 version.py
Hello from 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]
Install with pip to other version would be.
λ py -3.5 -m pip install logzero
Collecting logzero
Requirement already satisfied: colorama; sys_platform == "win32" in c:\python35\lib\site-packages (from logzero)
Installing collected packages: logzero
Successfully installed logzero-1.5.0
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  assigned variable fails to show up Skaperen 4 171 May-27-2019, 10:48 AM
Last Post: Skaperen
  No module named 'Pillow' MrMajorThorburn 4 518 May-11-2019, 07:17 AM
Last Post: MrMajorThorburn
  Append to Array Fails Jeff 1 188 Apr-10-2019, 12:41 PM
Last Post: ichabod801
  if clause fails DeadCthulhuWaitsDreaming 10 401 Apr-07-2019, 09:19 PM
Last Post: DeadCthulhuWaitsDreaming
  venv fails to link to python-dev include (Python.h) Moonwatcher 2 617 Dec-27-2018, 12:31 AM
Last Post: Moonwatcher
  "replace() method" fails to change string pw928gts 4 467 Nov-30-2018, 05:48 PM
Last Post: nilamo
  Python 2.7 LooseVersion version comparison unexpectedly fails kwutzke 5 552 Nov-27-2018, 10:23 AM
Last Post: kwutzke
  advapi32.SetServiceStatus() fails with error 6 crustydave 1 470 Nov-23-2018, 05:50 AM
Last Post: crustydave
  Python Pillow I_Am_Groot 1 525 Oct-13-2018, 07:28 AM
Last Post: j.crater
  [split] Python Pillow - Photo Manipulation keegan_010 1 426 Oct-11-2018, 09:57 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)