saf
saf

Reputation: 259

Getting Error While Installing Pillow using pip

I am Getting this error when i am installing pillow using command.

$pip install Pillow

and i am running this command in virtual environment

  File "/usr/lib/python2.7/distutils/command/install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run
    self.build_extensions()
  File "setup.py", line 515, in build_extensions
    % (f, f))
ValueError: --enable-jpeg requested but jpeg not found, aborting.

Upvotes: 0

Views: 1975

Answers (3)

dstudeba
dstudeba

Reputation: 9038

For AWS (Red Hat) you need to run the following two commands to get Pillow to install.

sudo yum install libjpeg
sudo yum install zlib-devel

Also note that you have to uninstall PIL if you are using it in the same environment.

Upvotes: 0

ChristosBacharakis
ChristosBacharakis

Reputation: 74

you need to install the zlib-devel package in Linux in order to resolve this particular issue.

dnf install zlib-devel

works for Fedora.

Upvotes: 1

Hugo
Hugo

Reputation: 29344

The newly released Python 3.0.0 now requires libjpeg for .jpg (and zlib for .png) by default.

From the docs:

  • Starting with Pillow 3.0.0, libjpeg is required by default, but may be disabled with the --disable-jpeg flag.

See here for how to use build options, and elsewhere on that page for instructions how to install libraries for different platforms.

Upvotes: 0

Related Questions