Erro fatal: Python.h não existe tal arquivo ou diretório

1
root@rani-System-Product-Name:~# sudo pip install python-igraph
Downloading/unpacking python-igraph
  Downloading python-igraph-0.7.1.post6.tar.gz (377Kb): 377Kb downloaded
  Running setup.py egg_info for package python-igraph

Installing collected packages: python-igraph
  Running setup.py install for python-igraph
    Build type: dynamic extension
    Include path:
    Library path:
    Runtime library path:
    Linked dynamic libraries: igraph
    Linked static libraries:
    Extra compiler options:
    Extra linker options:
    building 'igraph._igraph' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/arpackobject.c -o build/temp.linux-i686-2.7/src/arpackobject.o
    In file included from src/arpackobject.c:23:0:
    src/arpackobject.h:26:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/root/build/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-qMvawh-record/install-record.txt:
    running install

running build

running build_py

creating build

creating build/lib.linux-i686-2.7

creating build/lib.linux-i686-2.7/igraph

copying igraph/__init__.py -> build/lib.linux-i686-2.7/igraph

copying igraph/summary.py -> build/lib.linux-i686-2.7/igraph

copying igraph/utils.py -> build/lib.linux-i686-2.7/igraph

copying igraph/datatypes.py -> build/lib.linux-i686-2.7/igraph

copying igraph/statistics.py -> build/lib.linux-i686-2.7/igraph

copying igraph/compat.py -> build/lib.linux-i686-2.7/igraph

copying igraph/configuration.py -> build/lib.linux-i686-2.7/igraph

copying igraph/matching.py -> build/lib.linux-i686-2.7/igraph

copying igraph/layout.py -> build/lib.linux-i686-2.7/igraph

copying igraph/clustering.py -> build/lib.linux-i686-2.7/igraph

copying igraph/cut.py -> build/lib.linux-i686-2.7/igraph

copying igraph/formula.py -> build/lib.linux-i686-2.7/igraph

creating build/lib.linux-i686-2.7/igraph/test

copying igraph/test/basic.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/__init__.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/vertexseq.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/decomposition.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/indexing.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/utils.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/edgeseq.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/cliques.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/generators.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/atlas.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/flow.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/iterators.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/homepage.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/isomorphism.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/rng.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/matching.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/structural.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/separators.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/operators.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/spectral.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/games.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/conversion.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/layouts.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/foreign.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/attributes.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/colortests.py -> build/lib.linux-i686-2.7/igraph/test

copying igraph/test/bipartite.py -> build/lib.linux-i686-2.7/igraph/test

creating build/lib.linux-i686-2.7/igraph/app

copying igraph/app/__init__.py -> build/lib.linux-i686-2.7/igraph/app

copying igraph/app/shell.py -> build/lib.linux-i686-2.7/igraph/app

creating build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/text.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/baseclasses.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/__init__.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/shapes.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/utils.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/graph.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/metamagic.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/colors.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/vertex.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/coord.py -> build/lib.linux-i686-2.7/igraph/drawing

copying igraph/drawing/edge.py -> build/lib.linux-i686-2.7/igraph/drawing

creating build/lib.linux-i686-2.7/igraph/remote

copying igraph/remote/__init__.py -> build/lib.linux-i686-2.7/igraph/remote

copying igraph/remote/nexus.py -> build/lib.linux-i686-2.7/igraph/remote

copying igraph/remote/gephi.py -> build/lib.linux-i686-2.7/igraph/remote

creating build/lib.linux-i686-2.7/igraph/vendor

copying igraph/vendor/__init__.py -> build/lib.linux-i686-2.7/igraph/vendor

copying igraph/vendor/texttable.py -> build/lib.linux-i686-2.7/igraph/vendor

running build_ext

Build type: dynamic extension

Include path:

Library path:

Runtime library path:

Linked dynamic libraries: igraph

Linked static libraries:

Extra compiler options:

Extra linker options:

building 'igraph._igraph' extension

creating build/temp.linux-i686-2.7

creating build/temp.linux-i686-2.7/src

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/arpackobject.c -o build/temp.linux-i686-2.7/src/arpackobject.o

In file included from src/arpackobject.c:23:0:

src/arpackobject.h:26:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/root/build/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-qMvawh-record/install-record.txt failed with error code 1
Storing complete log in /root/.pip/pip.log

quando eu digito python na linha de comando, ele dá resultado da seguinte forma

root@rani-System-Product-Name:~# python
Python 2.7.5 (default, Jun 29 2015, 10:00:26) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

me ajude.

    
por Jose Kj 13.02.2016 / 07:16

1 resposta

3

Resposta genérica (sem foco em 12.04): Você está perdendo os "arquivos de cabeçalho Python" e eles estão dentro de 1 desses ...

sudo apt-get install python-dev
sudo apt-get install python-devel
sudo apt-get install python2.7-dev

ou você pode instalar todos os disponíveis com

sudo apt-get install python-all-dev

Digite python --version para ver qual versão do python você está usando.

Mais específico: como você está usando o 12.04, eu suponho que você precisa apenas de python2.7-dev .

    
por Rinzwind 13.02.2016 / 07:23