Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Pillow on Windows using pip?

Tags:

python

pillow

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?

like image 955
Paul Vincent Craven Avatar asked Jan 04 '16 15:01

Paul Vincent Craven


2 Answers

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.

like image 155
Hugo Avatar answered Oct 08 '22 01:10

Hugo


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

like image 44
Nikse Avatar answered Oct 08 '22 01:10

Nikse