[Fixed]-Pillow installation error: command 'gcc' failed with exit status 1

1👍

Solved. Priyank Patel was right… it’s a server-side permission issue. Thank you all!

unable to execute gcc: Permission denied . Ask hosting provide to run your command for you . – Priyank Patel yesterday

25👍

Make sure you have gcc and python-dev installed

sudo apt-get install gcc python-dev

11👍

I had a similar problem (gcc failed, but no mention of permissions), but it was dependencies that were my problem. By the way, my task was to install Pillow on a raspberry pi, which is why those dev libraries were necessary. They may not be necessary for you. It was the python-imaging command that did the trick most, I think. Here’s what I did:

# Add the deb-src for each deb in /etc/apt/sources list
sudo apt-get update
sudo apt-get install python2.7-dev tk8.5 tcl8.5 tk8.5-dev tcl8.5-dev
sudo apt-get build-dep python-imaging --fix-missing
sudo pip install Pillow

Sources:
https://github.com/python-imaging/Pillow/issues/322
http://forums.getpebble.com/discussion/8490/ubuntu-install-problem-when-it-comes-to-pip
https://unix.stackexchange.com/questions/105265/install-pil-pillow-via-pip-in-debian-testing-jessie

👤jstaab

4👍

In case this helps anyone else. This may be what the service provider did.

On CentOS I ended up having to install Python headers to fix the problem.

yum install python-devel

then

pip install Pillow

3👍

Try running this in terminal:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Then pip install Pillow

👤e h

0👍

You have to execute it in root directory.

Leave a comment