title: Error while installing Pillow on CentOS 6.6
body: <p>I am trying to install <code>psycopg2</code> as well as <code>Pillow 3.0</code> for Cent OS 6.6 from last 2 days. But it was not installing and throwing the errors. </p>
  
  <p>I looked up into all answers from Stack Overflow as well as blogs, but nothing works for me.</p>
  
  <p>Stack trace while installing Pillow is <strong>(NOTE: I also tried each solution available on the Stack Overflow for this too)</strong>:</p>
  
  <pre><code>(first)[root@localhost ~]# pip install Pillow
  Downloading/unpacking Pillow
    Downloading Pillow-3.0.0.tar.gz (9.6MB): 9.6MB downloaded
    Running setup.py egg_info for package Pillow
      Single threaded build, not installing mp_compile:1 processes
  
  Installing collected packages: Pillow
    Running setup.py install for Pillow
      Single threaded build, not installing mp_compile:1 processes
  
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "/root/.virtualenvs/first/build/Pillow/setup.py", line 767, in &lt;module&gt;
          zip_safe=not debug_build(),
        File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
          dist.run_commands()
        File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.virtualenvs/first/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 56, in run
        File "/usr/local/lib/python2.7/distutils/command/install.py", line 563, in run
          self.run_command('build')
        File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run
          self.run_command(cmd_name)
        File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python2.7/distutils/command/build_ext.py", line 337, in run
          self.build_extensions()
        File "/root/.virtualenvs/first/build/Pillow/setup.py", line 515, in build_extensions
          % (f, f))
      ValueError: --enable-jpeg requested but jpeg not found, aborting.
      Complete output from command /root/.virtualenvs/first/bin/python2.7 -c "import setuptools;__file__='/root/.virtualenvs/first/build/Pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MaTP1u-record/install-record.txt --single-version-externally-managed --install-headers /root/.virtualenvs/first/include/site/python2.7:
      Single threaded build, not installing mp_compile:1 processes
  
  running install
  
  running build
  
  running build_py
  
  creating build
  
  creating build/lib.linux-x86_64-2.7
  
  creating build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PSDraw.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/Hdf5StubImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PcfFontFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/McIdasImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageTk.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageColor.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImagePath.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageMorph.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PpmImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/JpegImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageStat.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PngImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PcdImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageGrab.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/MspImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/WalImageFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/_binary.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImagePalette.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageFont.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/GifImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/GribStubImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/TiffImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/FitsStubImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/BufrStubImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/SpiderImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/FpxImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/GdImageFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/Image.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageTransform.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/IcoImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/IptcImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/OleFileIO.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/WmfImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ContainerIO.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PsdImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/TarIO.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/XbmImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImtImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/FontFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/features.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageFilter.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/IcnsImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/TgaImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/_util.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageDraw2.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/GimpPaletteFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageWin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageShow.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/XVThumbImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ExifTags.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/__init__.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PalmImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageSequence.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PaletteFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/BdfFontFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/SunImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/TiffTags.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/CurImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PcxImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/GimpGradientFile.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageMode.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/XpmImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageChops.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/Jpeg2KImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PyAccess.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageCms.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageQt.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/EpsImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/MpoImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageEnhance.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageMath.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/FliImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/MpegImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/DcxImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/WebPImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/JpegPresets.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/BmpImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/GbrImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/MicImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PdfImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageOps.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/SgiImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/PixarImagePlugin.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  copying PIL/ImageDraw.py -&gt; build/lib.linux-x86_64-2.7/PIL
  
  running egg_info
  
  writing Pillow.egg-info/PKG-INFO
  
  writing top-level names to Pillow.egg-info/top_level.txt
  
  writing dependency_links to Pillow.egg-info/dependency_links.txt
  
  warning: manifest_maker: standard file '-c' not found
  
  
  
  reading manifest file 'Pillow.egg-info/SOURCES.txt'
  
  reading manifest template 'MANIFEST.in'
  
  writing manifest file 'Pillow.egg-info/SOURCES.txt'
  
  copying PIL/OleFileIO-README.md -&gt; build/lib.linux-x86_64-2.7/PIL
  
  running build_ext
  
  Traceback (most recent call last):
  
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  
    File "/root/.virtualenvs/first/build/Pillow/setup.py", line 767, in &lt;module&gt;
  
      zip_safe=not debug_build(),
  
    File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
  
      dist.run_commands()
  
    File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
  
      self.run_command(cmd)
  
    File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
  
      cmd_obj.run()
  
    File "/root/.virtualenvs/first/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 56, in run
  
    File "/usr/local/lib/python2.7/distutils/command/install.py", line 563, in run
  
      self.run_command('build')
  
    File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
  
      self.distribution.run_command(command)
  
    File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
  
      cmd_obj.run()
  
    File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run
  
      self.run_command(cmd_name)
  
    File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
  
      self.distribution.run_command(command)
  
    File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
  
      cmd_obj.run()
  
    File "/usr/local/lib/python2.7/distutils/command/build_ext.py", line 337, in run
  
      self.build_extensions()
  
    File "/root/.virtualenvs/first/build/Pillow/setup.py", line 515, in build_extensions
  
      % (f, f))
  
  ValueError: --enable-jpeg requested but jpeg not found, aborting.
  
  ----------------------------------------
  Command /root/.virtualenvs/first/bin/python2.7 -c "import setuptools;__file__='/root/.virtualenvs/first/build/Pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MaTP1u-record/install-record.txt --single-version-externally-managed --install-headers /root/.virtualenvs/first/include/site/python2.7 failed with error code 1 in /root/.virtualenvs/first/build/Pillow
  Storing complete log in /root/.pip/pip.log
  </code></pre>
  
  <p>NOTE: I have installed all packages <code>postgresql-devel</code> , <code>setuptools</code> and <code>python-devel</code>. The root is using <code>Python 2.6.6</code> and <code>virtualenv</code> is using <code>Python 2.7.10</code>. </p>
  
  <p>Please help me with this.</p>