Python Forum
lxml missing libxml2, libxslt
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
lxml missing libxml2, libxslt
#1
Recently installed Python 3.7 on Windows 10, personal computer.
How do i install libxml2 and libxslt?

Tried to install lxml using pip, which failed because of missing libxml2 and libxslt.
Tried pip install libxml2-python3 (and a couple others) found on pypi.org and they failed for various scripting errors
Tried to pip install lmxl from a .whl file which was a solution offered on a similar thread on this site in 2016 and it failed because of invalid requirements.
Goggled the problem and tried various suggested options, which did not work.

Been to the lxml and GitHub websites, followed advice on setting environmental variables, and am totally at a loss. Not blaming anything but my ignorance and I'm stuck.

Anyone with recent success installing these two libraries on Windows 10?
Reply
#2
For 3.6 there was only pip install lxml (libxml2,libxslt) is a part of lxml wheel in this install.
Maybe because 3.7 is so new yet,then it will try compile with command over(as in the old days before wheel).

So use wheel from gohlke.
Example i do it virtual environment to test new install:
(aaa) C:\aaa
λ python -V
Python 3.7.0

(aaa) C:\aaa
λ pip -V
pip 10.0.1 from c:\aaa\lib\site-packages\pip (python 3.7)

# Install
(aaa) C:\aaa
λ pip install lxml-4.2.3-cp37-cp37m-win32.whl
Processing c:\aaa\lxml-4.2.3-cp37-cp37m-win32.whl
Installing collected packages: lxml
Successfully installed lxml-4.2.3

# Test
(aaa) C:\aaa
λ python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>> etree.__version__
'4.2.3'
>>>
Reply
#3
Did use wheel from gohlke before posting. It did not work. If memory serves, it said the two libraries mentioned in subject were missing.
Reply
#4
The lxml wheel is build with libxml2 and libxslt.
So you should not get that these libraries are missing,if using lxml from wheel install.

What code are running when get this error?
Run the same in virtual environment,it's easy to use as it's now build into Python venv.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  lxml - etree/lxml need help storing variable for most inserted element goeb 0 2,554 Apr-01-2019, 03:09 AM
Last Post: goeb

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020