10

I'm trying to install Pillow 3.1 on Windows. Per the instructions, I should be able to just type in:

pip install Pillow

But I get:

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

Because now (starting with versions after 3.0 I think?) libjpeg is required for pillow to be installed. I don't know how to do that magic on Windows. Maybe install Ming or something. But I was really hoping for a simple pip install.

I can disable these options through the intuitive command:

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

But then the build fails because I don't have Visual C++ installed.

Yes, I can install Pillow by downloading it from the unofficial repository list. But is there a way to do it with pip on Windows without a lot of extra installs?

4
  • did you try to install libjpeg ? Commented Jan 4, 2016 at 15:49
  • First install Microsoft Visual C++ Compiler for Python 2.7 from http://aka.ms/vcpython27. You can also install binary dll from libjpeg / jpeg for windows.
    – Bob Dylan
    Commented Jan 4, 2016 at 15:51
  • 1
    You're going to need libjpeg, the Visual C++ 2008 compiler, and if you want support for things like PNG, TIFF, etc., you will also need to install zlib, libtiff, etc. I'd recommend installing from the prebuilt binary from UCI if possible. The alternative if you really want to install with pip without installing a bunch of extras is to pass all the flags to disable everything that requires an external library (though that means your Pillow install probably will be rather featureless).
    – wkl
    Commented Jan 4, 2016 at 16:01
  • 3
    The question asks for pip install, so not an answer, but would you consider installing it with conda? This works out-of-the-box on my machine (with anaconda): conda create -n pillow-test pillow.
    – steinar
    Commented Jan 4, 2016 at 16:04

4 Answers 4

7

By far the easiest thing to do on Windows is install Pillow using pre-built binaries rather than trying to build it yourself.

When there's a new Pillow release, it usually takes a day or so for the Windows binaries to be built and uploaded.

You ran into this problem during this window. The Windows binaries are now up so you can install with pip install pillow (or pip install -U pillow).

If you need Pillow during this window, you can install a given previous version with binaries like pip install pillow==3.0.0.

1

I install it By running command prompt as administrator pip install Pillow also we can mention specific version like pip install Pillow==2.6.1

0

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.

0

In django models, you can try:

python -m pip install Pillow
2
  • ...what does the question, or the command given in this answer, have to do with Django models?
    – Chris
    Commented Jul 3, 2022 at 17:11
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 3, 2022 at 17:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.