Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

71.1. python3-lxml-6.1.3

libxml2 and libxslt bindings for Python

6.1.3-1 · BSD-3-Clause · 2.1 SBU · 6.0 MiB, 126 files · 40_lang, 37 of 186 · ports/core/python-libs/python3-lxml

Homepage: https://lxml.de/

Why it is in KDOS. The comment above it in script/phases/40_lang/packages.d/python-libs.txt:

The XML parser a document pipeline needs. It binds a system library this tree already builds, which is why it is a port rather than an entry in somebody's vendor bundle.

lxml binds the C libraries libxml2 and libxslt to Python, with the ElementTree API, XPath, XSLT, XML Schema and an HTML parser. It is the XML parser the tree’s document tools build on, among them calibre, ocrmypdf, inkscape’s extensions and fonttools.

Depends on: python3, python3-setuptools, python3-pip, python3-cython, libxml2, libxslt, zlib.

Required by (15): breeze-icons, calibre, elogind, fonttools, gnuhealth, gtk-doc, inkscape, ocrmypdf, pandas, python3-openpyxl, python3-owslib, python3-pikepdf, qgis, selenium-webdriver-at-spi, visidata.

Sources: python3-lxml-6.1.3.tar.gz (4.0 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install python3-lxml'

build.sh:

pip3 install --ignore-installed --no-deps --no-index --no-build-isolation --root=$PKG --prefix=/usr .

Directories: /usr/lib/python3.14/site-packages/lxml, /usr/lib/python3.14/site-packages/lxml-6.1.3.dist-info, /usr/share/licenses/python3-lxml.

lxml.etree links the system libxml2.so, libxslt.so and libexslt.so: lxml’s setup.py builds against the installed libraries unless it is given its --static-deps option, which downloads and compiles private copies, and the recipe passes none. The source distribution ships the C files generated from lxml’s Cython sources, and setup.py compiles those as they are unless --with-cython is given or one of them is missing.