Skip to content

Installation

Requirements

  • Python 3.13+
  • WeasyPrint system libraries (only if you need PDF output — see below)

Install LeafPress

To use LeafPress as a CLI tool or desktop UI, install it globally with uv tool or pipx. To use it as a Python library in a project, use uv add or pip install.

Base

DOCX, HTML, ODT, EPUB output and document import — no system dependencies required.

uv tool install leafpress
pipx install leafpress
uv add leafpress
pip install leafpress

With PDF Support

PDF output requires WeasyPrint and its system libraries (Pango, HarfBuzz — see below).

uv tool install 'leafpress[pdf]'
pipx install 'leafpress[pdf]'
uv add 'leafpress[pdf]'
pip install 'leafpress[pdf]'

With Desktop UI

The menu bar / system tray app requires PyQt6:

uv tool install 'leafpress[ui]'
pipx install 'leafpress[ui]'
uv add 'leafpress[ui]'
pip install 'leafpress[ui]'

Everything

All optional features (PDF + UI):

uv tool install 'leafpress[all]'
pipx install 'leafpress[all]'
uv add 'leafpress[all]'
pip install 'leafpress[all]'

WeasyPrint System Dependencies

LeafPress uses WeasyPrint for PDF rendering. WeasyPrint requires Pango and related libraries. These are only needed if you install leafpress[pdf] or leafpress[all].

Ubuntu / Debian

sudo apt-get install -y \
  libpango-1.0-0 \
  libharfbuzz0b \
  libpangoft2-1.0-0 \
  libfontconfig1

Fedora / RHEL

sudo dnf install pango harfbuzz fontconfig

macOS

Do not use brew install weasyprint

brew install weasyprint installs a standalone CLI tool — it does not install the system libraries that the Python WeasyPrint package requires. Install the libraries below instead.

brew install cairo pango gdk-pixbuf libffi

If LeafPress still cannot find the libraries, add this to your shell profile (~/.zshrc or ~/.bash_profile) and restart your terminal:

export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH
brew install cairo pango gdk-pixbuf libffi

Windows

On Windows, WeasyPrint can be installed via pip. GTK+ libraries may be needed — see the WeasyPrint Windows installation guide.

Verify Installation

leafpress --version
leafpress --help