10

I am using PyCharm with Python 3.0 and I want to import Pillow Module.

While installing the Pillow module from Project Interpreter, I got a message which says:

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

enter image description here

I have also tried installing the same from command line by using both pip install and easy install but the command line is also throwing the same error.

I tried to find several solution in internet, but most of them are for Linux. for example, this solution: no module named zlib

How can I solve this issue in Windows and with PyCharm ?

Community
  • 1
  • 1
Bluemarble
  • 1,925
  • 4
  • 20
  • 35
  • 1
    For windows packages that would require compilation, one option is to download the precompiled wheel package from [Christoph Gohkle's site](http://www.lfd.uci.edu/~gohlke/pythonlibs/). It's an outstanding resource. – jedwards Aug 03 '16 at 03:19
  • Hi I tried to install the Pillow module found on the link you have provided. But it is throwing an error like this: Pillow-3.3.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform. I am using python 3.6.0a3 on Windows 10 64 bit. Any idea why I am getting this error ? – Bluemarble Aug 03 '16 at 03:38
  • You might consider [downloading](https://www.python.org/downloads/) a python in the stable branch -- 3.5.2 maybe? (Instead of a pre-release version) You'll generally find more packages are available for 3.5. Then the wheel you already downloaded should work (provided you install a 64-bit version of Python 3.5). – jedwards Aug 03 '16 at 03:48
  • 1
    I will try that. thanks a lot. – Bluemarble Aug 03 '16 at 04:06
  • For the record I get this in Python 2.7.x – Jonathan Feb 14 '17 at 19:41

3 Answers3

10

Its Simple Go To Virtualenv

and run

easy_install Pillow

It works fine

sottany
  • 1,098
  • 8
  • 14
  • 2
    They distutils/python team really needs to get their act together. It makes no sense to have to switch between pip & easy_install. No other language does this – Jonathan Feb 14 '17 at 19:46
  • 2
    I am getting the same "RequiredDependencyException('\n\nThe headers or library files could not be found for zlib,\na required dependency when compiling Pillow from source.\n" using easy_install in the Virtualenv. – user2665773 Feb 09 '20 at 18:05
  • Same here, still not working and getting RequiredDependencyException – moarra Dec 30 '21 at 16:12
2

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.

Doogle
  • 1,236
  • 1
  • 17
  • 17
-3

files > Settings > Project Test > Project Interpreter > ADD > Pillow-PIL