/ / lxml gcc non è riuscito con exit status 1 ubuntu 16.04 - python, lxml

lxml gcc non è riuscito con exit status 1 ubuntu 16.04 - python, lxml

sudo easy_install lxml
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 3.6.4
Downloading https://pypi.python.org/packages/4f/3f/cf6daac551fc36cddafa1a71ed48ea5fd642e5feabd3a0d83b8c3dfd0cb4/lxml-3.6.4.tar.gz#md5=6dd7314233029d9dab0156e7b1c7830b
Processing lxml-3.6.4.tar.gz
Writing /tmp/easy_install-w86uerbh/lxml-3.6.4/setup.cfg
Running lxml-3.6.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-w86uerbh/lxml-3.6.4/egg-dist-tmp-smgpuu2j
Building lxml version 3.6.4.
Building without Cython.
Using build configuration of libxslt 1.1.28
src/lxml/lxml.etree.c:83:20: fatal error: Python.h: No such file or directory
compilation terminated.
Compile failed: command "x86_64-linux-gnu-gcc" failed with exit status 1
/tmp/easy_install-w86uerbh/lxml-3.6.4/temp/xmlXPathInitmvs80t9r.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main (int argc, char **argv) {
^
error: Setup script exited with error: command "x86_64-linux-gnu-gcc" failed with exit status 1

Quindi, come posso installare lxml lib? Ho provato pip, ma c'è la stessa finitura.

risposte:

0 per risposta № 1

Prova ad installare i seguenti pacchetti:

sudo apt-get install libxml2-dev libxslt1-dev python-dev

Se questo non funziona, assicurati che non si tratti di un problema di memoria, in tal caso dovrai aumentare la memoria della tua macchina.


0 per risposta № 2

Bastava aggiungere più memoria all'istanza per completare la compilazione lxml