Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install python lxml #8

Closed
nico202 opened this issue Nov 2, 2015 · 25 comments
Closed

Install python lxml #8

nico202 opened this issue Nov 2, 2015 · 25 comments

Comments

@nico202
Copy link

nico202 commented Nov 2, 2015

Hi, I'd like to install lxml.
I installed python2, and pip2 works for many packages, but not for lxml (pyconfig.h not found)
Anybody had success installing it?
Thanks :)

@fornwall
Copy link
Member

fornwall commented Nov 2, 2015

Hi, pyconfig.h can be installed from the python2-dev package! Does installing lxml work for you after that?

@nico202
Copy link
Author

nico202 commented Nov 2, 2015

installed the package, now fails including libxml/xmlversion.h
thanks
EDIT:
installing libxml2-dev, fails same way

@fornwall
Copy link
Member

fornwall commented Nov 5, 2015

I reproduced the problem:

In file included from src/lxml/lxml.etree.c:239:0:
/data/data/com.termux/files/usr/tmp/pip-build-Vw5Hjr/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
#include "libxml/xmlversion.h"

The file $PREFIX/include/libxml2/libxml/xmlversion.h exists after installing libxml2-dev, but is not found since -I$PREFIX/include/libxml2 is not used when compiling for some reason...

@fornwall
Copy link
Member

Hi, the issue was that the libxml2-dev package lacked the xml2-config utility which lxml needs to build.

This has now been fixed, run apt update && apt upgrade and try to install lxml again.

Re-open the issue if it still doesn't work for you!

@jimzenn
Copy link

jimzenn commented Mar 9, 2017

The problem seems to be unsolved.

/data/data/com.termux/files/usr/tmp/xmlXPathInit0mNYHx.c:1:10: fatal error: 'libxml/xpath.h' file not found      
 #include "libxml/xpath.h"
                                  ^                                        
       1 error generated.                                       
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?                                 
*********************************************************************************
error: command 'aarch64-linux-android-gcc' failed with exit status 1                                                                                                       ----------------------------------------

Here's what I got.

@fornwall
Copy link
Member

fornwall commented Mar 9, 2017

@Jim-Zenn Have you installed libxml2-dev with apt install libxml2-dev?

@jimzenn
Copy link

jimzenn commented Mar 9, 2017

Yes, I have. Can you reproduce this issue?

@jimzenn
Copy link

jimzenn commented Mar 10, 2017

It seems I succeeded to install after installing libxml2-utils, thanks!

@rafi16jan
Copy link

hey @fornwall I still got this issue even though I already install libxml2 libxml2-dev and libxml2-utils, how can I found a workaround?

@Grimler91
Copy link
Member

@rafi16jan What error do you get?

@rafi16jan
Copy link

@Grimler91 I already got a workaround, I install libxslt1 and it worked

@Demigoddd
Copy link

@Grimler91 How did you install libxslt1 ?

@Grimler91
Copy link
Member

@deathlive apt search xslt shows me the packages libxslt and libxslt-dev so those are the ones you're after

@pigeonflight
Copy link

After install libxml2-dev, libxml2-utils and libxslt

pip2 install lxml

still fails with the following output:

unable to execute 'cc': No such file or directory
....
error: command 'i686-linux-clang' failed with exit status 1

@pigeonflight
Copy link

It seems I was missing 'clang'.

pkg install clang

did the trick, so I'm back on track. Now to go figure out how to cut and paste from termux.

krowvin added a commit to krowvin/FreeNAS-Config-Backup-Python-NC that referenced this issue May 4, 2018
libxml needs to be explicitly called in the pkg install
termux/termux-app#8
@cy3erGh0sT
Copy link

cy3erGh0sT commented Aug 16, 2018

I still have error installing lxml with ('Python.h' file not found).Anybody have any solution?.

I try again after installing python2-dev now fails including 'crypt.h'

thank you.

@ghost
Copy link

ghost commented Aug 16, 2018

@cy3erGh0sT libcrypt-dev needed

@cy3erGh0sT
Copy link

Thank you very much.The problem has been fixed after installing libcrypt-dev.

@QGB
Copy link

QGB commented Aug 23, 2018

python3 2018-08

$PREFIX/include/libxml2/libxml/xmlversion.h exists after installing libxml2-dev, but is not found since -I$PREFIX/include/libxml2 is not used when compiling for some reason...

@dpshelio
Copy link

This may help:

pip install --global-option=build_ext --global-option="-I$PREFIX/include/libxml2" lxml

@unsuitable001
Copy link

Hey buddies, looks like there's too much mess (& dependencies) to figure out.
So, I just compiled it & uploaded the wheel file.
Now, you don't have to have the headache. Just install the wheel.
Wheels are in my repository :
https://github.com/unsuitable001/pip-arm-wheel/tree/master/aarch64/lxml

@medram
Copy link

medram commented Oct 29, 2019

hey there,
I solved this problem using
pkg install clang
pkg install libxml2 libxslt
pip install cython
pip install lxml
have a good day :-)

@ajitjadhav28
Copy link

@Grimler91 I already got a workaround, I install libxslt1 and it worked

Working(python3):
apt install clang libxml2 libxslt
then install lxml by pip install lxml

@dyaus2613
Copy link

it solved my problem
I use these
pip install wheel
pkg install libxml2 libxslt

@sk8heidong
Copy link

ok
now ihave lxml
so exciting ~

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests