[Tutor] pip install lxml fails

Alex Kleider akleider at sonic.net
Thu Apr 9 04:44:39 CEST 2015


In the process of trying to learn about web scraping
(http://docs.python-guide.org/en/latest/scenarios/scrape/)
I tried to pip install lxml.

Can anyone suggest a remedy?

The output goes on for many pages and the resulting .pip/pip.log
file is almost 900 lines long
but the main meat of the failure seems to be in the following:

(env)alex at t61p:~/P3env/declination.d$ pip install lxml
Downloading/unpacking lxml
   Downloading lxml-3.4.2.tar.gz (3.5MB): 3.5MB downloaded
   Running setup.py (path:/home/alex/P3env/env/build/lxml/setup.py) 
egg_info for package lxml
     Building lxml version 3.4.2.
     Building without Cython.
     Using build configuration of libxslt 1.1.28
     /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown 
distribution option: 'bugtrack_url'
       warnings.warn(msg)

     warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
   Running setup.py install for lxml
     Building lxml version 3.4.2.
     Building without Cython.
     Using build configuration of libxslt 1.1.28
     building 'lxml.etree' extension
     i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC 
-I/usr/include/libxml2 
-I/home/alex/P3env/env/build/lxml/src/lxml/includes 
-I/usr/include/python3.4m -I/home/alex/P3env/env/include/python3.4m -c 
src/lxml/lxml.etree.c -o build/temp.linux-i686-3.4/src/lxml/lxml.etree.o 
-w
     src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: No such file or 
directory
      #include "pyconfig.h"
                           ^
     compilation terminated.
     /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown 
distribution option: 'bugtrack_url'
       warnings.warn(msg)
     error: command 'i686-linux-gnu-gcc' failed with exit status 1
     Complete output from command /home/alex/P3env/env/bin/python3 -c 
"import setuptools, 
tokenize;__file__='/home/alex/P3env/env/build/lxml/setup.py';exec(compile(getattr(tokenize, 
'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 
'exec'))" install --record /tmp/pip-sknxo73w-record/install-record.txt 
--single-version-externally-managed --compile --install-headers 
/home/alex/P3env/env/include/site/python3.4:
......


More information about the Tutor mailing list