dervin
Posts: 5
Joined: Sat Jun 07, 2014 8:15 pm

Unable to install python-dev

Sat Jun 07, 2014 8:25 pm

Hello

When I'm trying to install python-dev with

Code: Select all

sudo pip install Pillow
, I get this error message:
  • gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBZ -I/usr/include/freetype2 -I/tmp/pip_build_root/Pillow/libImaging -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -I/usr/include/arm-linux-gnueabihf -c _imaging.c -o build/temp.linux-armv6l-2.7/_imaging.o

    _imaging.c:76:20: fatal error: Python.h: No such file or directory

    compilation terminated.

    error: command 'gcc' failed with exit status 1

    ----------------------------------------
    Cleaning up...
    Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ARlKYX-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/Pillow
    Storing debug log for failure in /root/.pip/pip.log
Anyone knows how to fix this?
thx for help :)

DirkS
Posts: 10308
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to install python-dev

Sun Jun 08, 2014 1:54 am

dervin wrote:When I'm trying to install python-dev with

Code: Select all

sudo pip install Pillow
, I get this error message:
That doesn't look right to me. You're trying to install Pillow (version of Python Imaging Library) with that command. One of the prerequisites is python-dev.
See http://pillow.readthedocs.org/en/latest ... stallation.
As you can see there you'll have to install python-dev first using apt-get:

Code: Select all

sudo apt-get install python-dev
HTH
Dirk.

dervin
Posts: 5
Joined: Sat Jun 07, 2014 8:15 pm

Re: Unable to install python-dev

Sun Jun 08, 2014 10:50 am

That doesn't look right to me. You're trying to install Pillow (version of Python Imaging Library) with that command. One of the prerequisites is python-dev.
See http://pillow.readthedocs.org/en/latest ... stallation.
As you can see there you'll have to install python-dev first using apt-get:
CODE: SELECT ALL
sudo apt-get install python-dev


HTH
Dirk.
I tried to install python-dev but then this error message shows up:

Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python

E: Package 'python-dev' has no installation candidate


I also tried

Code: Select all

sudo apt-get update

DirkS
Posts: 10308
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to install python-dev

Sun Jun 08, 2014 3:55 pm

Very odd. Ok, back to basics...

Which distro are you using (Raspbian, Arch or other).

You mentioned to tried 'sudo apt-get update'. Did you get any error messages?

Did you try to install python-dev *after* running the apt-get update?

Gr.
Dirk.

dervin
Posts: 5
Joined: Sat Jun 07, 2014 8:15 pm

Re: Unable to install python-dev

Sun Jun 08, 2014 4:10 pm

I'm running Raspbian and the command 'sudo apt-get update' was successful. But after I tried to install the python-dev the same error message occurred. :/

thx for the answer
dervin

DirkS
Posts: 10308
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to install python-dev

Sun Jun 08, 2014 4:24 pm

Right now I don't know what to check next...
Maybe someone else has an idea?

Gr.
Dirk.

User avatar
rpdom
Posts: 16764
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Unable to install python-dev

Sun Jun 08, 2014 4:36 pm

Can you list the contents of the file /etc/apt/sources.list and also all files in /etc/sources.list.d/?

It sounds like you may have something missing from one of these.

dervin
Posts: 5
Joined: Sat Jun 07, 2014 8:15 pm

Re: Unable to install python-dev

Sun Jun 08, 2014 4:41 pm

sources.list: http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
I can't find anything named with sources.list.d in /etc :/

DirkS
Posts: 10308
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to install python-dev

Sun Jun 08, 2014 4:45 pm

Yes, that would explain it.

Normally the first line is:

Code: Select all

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
Insert this line at the top of the file and save it.
After this you should run apt-get update again before trying to install python-dev

HTH
Dirk.

dervin
Posts: 5
Joined: Sat Jun 07, 2014 8:15 pm

Re: Unable to install python-dev

Sun Jun 08, 2014 4:55 pm

Thank you very much!! I could finally install it now

Return to “Troubleshooting”