Get a build failed message upon pip install coverage

Issue #381 duplicate
Ikuru Kanuma
created an issue

Im running Debian 8 and pyton 2.7.9. Although coverage run <program> etc work extremely well, I got the following message when getting the package from pip.

Will close this immediately if it is a non issue.

Downloading/unpacking coverage
  Downloading coverage-3.7.1.tar.gz (284kB): 284kB downloaded
  Running setup.py (path:/tmp/pip-build-loURon/coverage/setup.py) egg_info for package coverage

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Installing collected packages: coverage
  Running setup.py install for coverage
    building 'coverage.tracer' extension
    i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c coverage/tracer.c -o build/temp.linux-i686-2.7/coverage/tracer.o
    coverage/tracer.c:3:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    **
    ** Couldn't install with extension module, trying without it...
    ** BuildFailed: command 'i586-linux-gnu-gcc' failed with exit status 1
    **

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    Installing coverage2 script to /usr/local/bin
    Installing coverage-2.7 script to /usr/local/bin
    Installing coverage script to /usr/local/bin
Successfully installed coverage
Cleaning up...

Comments (8)

  1. Ikuru Kanuma reporter

    Thanks for the blazingly fast reply! (And sorry for not responding earlier!)

    It would be nice if it is clear that the 'build failed' message actually means that I do not have the prerequisite for a optional speedup.

    Perhaps a smoother path for a first timer like me, would be: 1. pip notices that python.h is not in the system 2. Notify that an optional speed up with the c module is not available. 3. Prompt the user to either -suspend installation and let the user install the Pydev package, -or proceed twith pyton installation only

    As I really do not know how pip does stuff, not sure whats actually the best though.

    Separate qustion from above: as for now if I want to get the faster version, I should get the python-dev package, remove the current installation and re-install?

  2. Ned Batchelder repo owner

    @Ikuru Kanuma Sorry I didn't answer your last question, yes, getting python-dev and re-installing should work. Unfortunately, it's very difficult to build an install workflow with setup.py. I'll close this issue as a duplicate of another also discussing installation issues with compiling, maybe we can get better answers there.

  3. Log in to comment