[Tutor] pip install lxml fails

Stefan Behnel stefan_ml at behnel.de
Thu Apr 9 18:11:25 CEST 2015


Alex Kleider schrieb am 09.04.2015 um 17:29:
> On 2015-04-09 07:08, Brandon McCaig wrote:
>> I'm a python newbie, but it looks to me like your compiler cannot
>> find your header files, and in particular pyconfig.h.
>>
>> I tried searching my system and found a file with that name at
>> these locations:
>>
>>     /home/bambams/src/pyenv/versions/2.7.9/include/python2.7/pyconfig.h
>>     /home/bambams/src/pyenv/versions/3.4.2/include/python3.4m/pyconfig.h
>>     /usr/include/python2.6/pyconfig.h
>>     /usr/include/python2.7/pyconfig.h
>>     /usr/include/python3.2mu/pyconfig.h
>>
>> Based on that I am assuming that you should have a pyconfig.h in
>> either /usr/include/python3.4m or
>> /home/alex/P3env/env/include/python3.4m. I would probably start
>> there to verify that I have that header file in a location where
>> it's expected (-I flags in the above command, or system include
>> directories). If not then I would wonder why...
> 
> I have corresponding files in /usr/include for 2.7 but not for 3*:
> alex at t61p:~/P3env/env$ ls -ld /usr/include/python*
> drwxr-xr-x 2 root root 4096 Apr  8 19:05 /usr/include/python2.7
> 
> alex at t61p:~/P3env/env$ ls
> bin  lib
> Nothing in the env file (generated by virtualenv.)
> 
> My Ubuntu 14.04 system comes with Python3 by default so it does exist:
> alex at t61p:~/P3env/env$ which python3
> /usr/bin/python3
> It's a mystery why it doesn't come with the corresponding include directory.
> 
> I'm guessing this is a system level problem that can probably only be
> solved by someone at Ubuntu or one of the lxml maintainers.

It's solved already. :)

All you need to do is install the "-dev" package that goes with your Python
installation, e.g. "python3-dev" should match Python 3.4 in current Ubuntu
releases.

The reason why it's in a separate package is that many people actually
don't need this, e.g. when they only install plain Python packages or use
the Ubuntu provided binary packages that they can install via apt (e.g.
"sudo apt-get install python-lxml").

Stefan




More information about the Tutor mailing list