You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use pymupdf-lite: pymupdf 2.0 pulls heavy dependencies (onnxruntime, numpy, ...) #372
zimscraperlib only uses pymupdf to open PDFs and extract their text / metadata (zim/indexing.py), so pulling onnxruntime and numpy (hundreds of MB) into every scraper image is not acceptable.
Additionally, onnxruntime has no Python 3.15 wheel yet, so on Python 3.15 pip silently falls back to pymupdf 1.28.2.
For now, pymupdf is going to be pinned to <2.0, in 5.5.1 (for Python 3.14) and in the upcoming Python 3.15 / libzim 4 version.
To revisit when:
pymupdf makes these dependencies optional (extras) or ships a lean variant of 2.x
or 1.x stops receiving fixes, especially security ones (2.0 fixed CVE-2026-82035, in its CLI font extraction which we do not use)
Artifex publishes an official lean variant: pymupdf-lite, built from the same pymupdf/PyMuPDF repository, which is "a cut-down version of PyMuPDF without the PyMuPDF Layout engine".
Findings:
no dependency at all, 25.8 MB wheel, vs 68.9 MB for pymupdf 2.0 plus its onnxruntime, numpy, networkx, pymupdf4llm, pymupdf-layout, ... dependencies
abi3 wheels for Python 3.11 to 3.15 (so Python 3.15 is supported out of the box, unlike pymupdf 2.0 whose onnxruntime dependency has no 3.15 wheel)
drop-in replacement: it installs the very same pymupdf (and fitz) package, the full pymupdf wheel only adds pymupdf/layout/*, _features.so, _tgif.so and pymupdf4llm, none of which we use (we only open documents and extract their text and metadata)
Caveat: since both distributions install the same pymupdf package, a scraper also depending on the full pymupdf must keep both at the same version, and uninstalling one of them removes the files of the other (import pymupdf then fails while pymupdf-lite is still listed as installed). Fresh installs (e.g. scrapers Docker images) are not affected.
Plan: depend on pymupdf-lite>=2.0,<3.0 instead of pinning pymupdf<2.0, in #373 (5.5.1, Python 3.14) and #374 (6.0.0, Python 3.15). This issue will be closed by #373.
changed the title [-]pymupdf 2.0 pulls heavy dependencies (onnxruntime, numpy, ...)[/-][+]Use pymupdf-lite: pymupdf 2.0 pulls heavy dependencies (onnxruntime, numpy, ...)[/+]on Oct 29, 2026
Activity
Support only Python 3.15, with libzim 4
benoit74 commentedon Oct 29, 2026
Artifex publishes an official lean variant: pymupdf-lite, built from the same pymupdf/PyMuPDF repository, which is "a cut-down version of PyMuPDF without the PyMuPDF Layout engine".
Findings:
pymupdf2.0 plus itsonnxruntime,numpy,networkx,pymupdf4llm,pymupdf-layout, ... dependenciespymupdf2.0 whoseonnxruntimedependency has no 3.15 wheel)pymupdf(andfitz) package, the fullpymupdfwheel only addspymupdf/layout/*,_features.so,_tgif.soandpymupdf4llm, none of which we use (we only open documents and extract their text and metadata)pymupdf-lite>=2.0,<3.0on both Python 3.14 (main) and Python 3.15 (Support only Python 3.15, with libzim 4 #374), with no other package pulledCaveat: since both distributions install the same
pymupdfpackage, a scraper also depending on the fullpymupdfmust keep both at the same version, and uninstalling one of them removes the files of the other (import pymupdfthen fails whilepymupdf-liteis still listed as installed). Fresh installs (e.g. scrapers Docker images) are not affected.Plan: depend on
pymupdf-lite>=2.0,<3.0instead of pinningpymupdf<2.0, in #373 (5.5.1, Python 3.14) and #374 (6.0.0, Python 3.15). This issue will be closed by #373.[-]pymupdf 2.0 pulls heavy dependencies (onnxruntime, numpy, ...)[/-][+]Use pymupdf-lite: pymupdf 2.0 pulls heavy dependencies (onnxruntime, numpy, ...)[/+]Depend on pymupdf-lite instead of pymupdf
Support only Python 3.15, with libzim 4