RFC: Require libjpeg and zlib by default #1412

Closed
wiredfool opened this Issue Sep 9, 2015 · 13 comments

Projects

None yet

6 participants

@wiredfool
Member

_EDIT AFTER CLOSE_

If you're having compilation errors on Windows or Mac and you usually install from a binary -- Check to see if we've released a new version lately. It takes a day for all the binaries to get built and uploaded, and in the meantime, pip will try to grab the source, compile it and fail.

_end edit_

The world has progressed, and some things are just expected of an imaging library now, like jpeg and png support.

I propose that the default now be to require that libjpeg and zlib be found, unless they are explicitly disabled with the command line flags --disable-jpeg and --disable-zlib.

@wiredfool wiredfool added this to the 3.0.0 milestone Sep 9, 2015
@wiredfool wiredfool added the Install label Sep 9, 2015
This was referenced Sep 20, 2015
@hugovk
Member
hugovk commented Sep 23, 2015

👍

@hugovk hugovk closed this Sep 23, 2015
@aclark4life
Member

A belated and enthusiastic 👍

@gregory-marton

Unsure how to pass --disable-jpeg to pip. Tried

pip install --upgrade pillow --global-option="--disable-jpeg"
pip install --upgrade pillow --install-option="--disable-jpeg"

but both fail with

Complete output from command /tmp/foo/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-6rGUcw/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" --disable-jpeg install --record /tmp/pip-U18BC2-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/foo/include/site/python2.7/pillow:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: -c --help [cmd1 cmd2 ...]
   or: -c --help-commands
   or: -c cmd --help

error: option --disable-jpeg not recognized

I suspect this is relevant, but unsure yet as to how:
http://stackoverflow.com/questions/677577/distutils-how-to-pass-a-user-defined-parameter-to-setup-py

Got it!!!

pip install --upgrade pillow --global-option="build_ext" --global-option="--disable-jpeg"
@wiredfool wiredfool added a commit to wiredfool/Pillow that referenced this issue Dec 28, 2015
@wiredfool wiredfool Added documentation for abusing pip to send --enable-[feature] flags …
…to the build Ref:#1412
e5f2b3d
@wiredfool
Member

I know I've said in the past that it's not our place to be documenting pip's quirks.

@pvcraven
pvcraven commented Jan 4, 2016

As someone who is trying to get Pillow to work, I appreciate the documentation of pip's quirks. Also, I have no idea how this is supposed to work on Windows. Does this introduce a dependency on Ming, just to get JPG support?

@aclark4life
Member

I don't mind documenting pip's quirks. @pvcraven You would need Ming if you are compiling, but ideally you'd use a pre-built binary egg or wheel. In such cases, I think Pillow either includes image libraries or expects them to be in a specific location.

@wiredfool
Member

Compiling on windows is it's own special thing. There's an entire directory of stuff in Pillow/winbuild that will build pillow on some subset of our dependencies using the MS compilers.

If you're looking for 3.1, we'll have binaries soon. You're better off waiting. If you're looking to understand the build process, you can dig into that directory.

@pvcraven
pvcraven commented Jan 4, 2016

Ok, knowing binaries are coming is great news! I've got a library that depends on Pillow, and asking windows users to "Please install Visual C++" is a kill-joy.

@pvcraven
pvcraven commented Jan 4, 2016

Oh, this is really new. I see it killed automated AppVeyor builds that worked only yesterday.

@wiredfool
Member

Yeah, 3.1 was released this morning, and pip generally fails in unhelpful ways on Windows until binaries are available.

@wiredfool
Member

3.1 Binaries are up.

And to people googling and finding this thread -- If you're having compilation errors on Windows or Mac and you usually install from a binary -- Check to see if we've released a new version lately. It takes a day for all the binaries to get built and uploaded, and in the meantime, pip will try to grab the source, compile it and fail.

@hugovk
Member
hugovk commented Jan 4, 2016

And to people googling and finding this thread, part 2: here's how to install a specific version.

If 3.1.0 is just out (no binaries ready) and 3.0.0 was the last release (has binaries), install the last one like:

pip install pillow==3.0.0

@joka joka added a commit to liqd/adhocracy3 that referenced this issue Jun 11, 2016
@joka joka update Pillow from 2.7 to 3.2
Among other improvement zlib and libjpeg are now required
(python-pillow/Pillow#1412 ).
This should fix issues like
#2396 .
34ba042
@joka joka referenced this issue in liqd/adhocracy3 Jun 11, 2016
Merged

update Pillow from 2.7 to 3.2 #2408

@debu999
debu999 commented Jan 1, 2017

I spent almost a day figuring out what is wrong with pillow installation. It was working fine till yesterday and suddenly stopped working from today. Finally got it figured out, Few of my team mates upgraded python to 3.6 version which is now available for download. Since Pillow is not yet made compatible with 3.6 and is supporting only till 3.5.2 this error popped up.

Resolution is to check if Pillow supports your version of python. Once I reverted python back to 3.5.2 the installation worked like a charm and no errors encountered.

Hope this help resolve your issue.

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