Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install Pillow on centos

I have cenots 6.3 and python 2.6 on it when I try to install it via easyinstall I get following error:

_imaging.c:76:20: error: Python.h: No such file or directory
In file included from /tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/Imaging.h:14,
                 from _imaging.c:82:
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/ImPlatform.h:14:2: error: #error Sorry, this library requires support for ANSI prototypes.
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/ImPlatform.h:17:2: error: #error Sorry, this library requires ANSI header files.
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/ImPlatform.h:55:2: error: #error Cannot find required 32-bit integer type
In file included from _imaging.c:82:
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/Imaging.h:93: error: expected specifier-qualifier-list before ‘INT32’
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/Imaging.h:400: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ImagingCRC32’
......................
_imaging.c:3409: error: expected ‘)’ before ‘*’ token
error: Setup script exited with error: command 'gcc' failed with exit status 1

by the way, my gcc compiler is 4.4.7, if that helps.

like image 314
eneepo Avatar asked Jan 06 '14 08:01

eneepo


People also ask

Which command is used to install pillow in Linux OS?

To fix the error, install the pillow library using “ pip install pillow ” or “ pip3 install pillow ” in your operating system's shell or terminal first.

Is PIL and pillow the same?

What is PIL/Pillow? PIL (Python Imaging Library) adds many image processing features to Python. Pillow is a fork of PIL that adds some user-friendly features.

Why is pillow not working Python?

The most frequent source of this error is that you haven't installed pillow explicitly with pip install pillow . Alternatively, you may have different Python versions on your computer, and pillow is not installed for the particular version you're using.

How do I import a pillow module?

To load the image, we simply import the image module from the pillow and call the Image. open(), passing the image filename. Instead of calling the Pillow module, we will call the PIL module as to make it backward compatible with an older module called Python Imaging Library (PIL).


2 Answers

You need to install python26-devel before you can compile any Python extension.

To compile Pillow, you'll also need to install the development headers for various other libraries, including libjpeg-devel and zlib-devel. See the Pillow installation instructions for more details on what external libraries are needed.

like image 87
Martijn Pieters Avatar answered Oct 20 '22 00:10

Martijn Pieters


Make sure run this first:
sudo yum install python-devel libjpeg-devel zlib-devel

like image 34
vancexu Avatar answered Oct 20 '22 01:10

vancexu