Error installing Pillow on ubuntu 14.04

25,851

Solution 1

The problem was that the package libjpeg-dev was not installed. To solve the problem you should do this:

sudo apt-get install libjpeg-dev

Solution 2

Make sure Python-development packages are installed, if not then install it using the following commands :

For Ubuntu

sudo apt-get install python3-dev python3-setuptools

For Fedora

sudo dnf install python-devel

After installing the development packages install the following :

For Ubuntu

sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk

For Fedora

sudo dnf install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
lcms2-devel libwebp-devel tcl-devel tk-devel

Solution 3

You have to install the missing dependencies and libraries that Pillow requires for it to work. Find the dependencies here

This are the current dependancies/libraries for Ubuntu 14.04 for Pilllow 3.0.0+. Install them by running the command below

sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk

Solution 4

There may be a problem where pip is relying on a cached version of the dependencies, and clearing the cache can sometimes solve the problem. Just type

$ rm -rf ~/.cache/pip

Source: github issue

Share:
25,851
Navid777
Author by

Navid777

I'm a mathematics student in Sharif University of Technology

Updated on April 05, 2020

Comments

  • Navid777
    Navid777 about 4 years

    I'm trying to install Pillow on Ubuntu 14.04 using this command:

    pip install Pillow
    

    but the installation fails with this error:

    ValueError: --enable-jpeg requested but jpeg not found, aborting.
    
  • spectras
    spectras over 8 years
    This. Throw in zlib1g-dev as well if you want PNG support.
  • Jahongir Rahmonov
    Jahongir Rahmonov about 8 years
    This worked for me too! They should have libjpeg-dev as a dependency then!
  • akki
    akki almost 8 years
    After this sudo apt-get install zlib1g-dev
  • TAH
    TAH almost 8 years
    yum install libjpeg-devel on Fedora
  • ygesher
    ygesher over 7 years
    @JahongirRahmonov See my answer below. The dependencies are declared, but sometimes pip relies on an outdated cache.