Installation¶
Requirements¶
In order to use svglab, you need to have Python 3.11 or higher installed on your system. You can download the latest version of Python from the official website or use your system's package manager.
svglab bundles a small Rust extension module that binds resvg, the renderer behind Svg.render(). Prebuilt wheels are published for Linux (glibc and musl), macOS and Windows on x86-64 and ARM64, so most users need nothing else. On any other platform the package is built from source, which requires a Rust toolchain of version 1.85 or newer.
Wheels for the free-threaded build of CPython 3.14 (3.14t) are published as well. On those builds the GIL is re-enabled when svglab is imported, because lxml does not yet declare support for free-threading, so rendering does not run in parallel by default. Setting PYTHON_GIL=0 overrides this, but it opts every dependency into free-threading whether or not it is ready for it.
Install from PyPI¶
Tagged releases are available on PyPI and can be installed using pip, poetry, uv or any other Python package manager.
Optional extras¶
The html5lib extra installs html5lib, which enables parse_svg(..., parser="html5lib"). The other parsers (lxml-xml, the default, as well as lxml and html.parser) need nothing beyond the base dependencies.
Install from source¶
Alternatively, the latest development version can be installed directly from the GitHub repository: