# Compiling nbconvert with Nuitka

**URL:** <https://discourse.jupyter.org/t/compiling-nbconvert-with-nuitka/38217>\
**Category:** nbconvert\
**Tags:** help-wanted\
**Created:** [December 8, 2025, 3:28pm UTC](https://discourse.jupyter.org/t/compiling-nbconvert-with-nuitka/38217 "2025-12-08T15:28:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miek770](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/miek770/32/21240_2.png) [@miek770](https://discourse.jupyter.org/u/miek770)\
**Post date:** [December 8, 2025, 3:28pm UTC](https://discourse.jupyter.org/t/compiling-nbconvert-with-nuitka/38217/1 "2025-12-08T15:28:27Z")

</div>

Hi, does anyone here have any experience with compiling nbconvert with Nuitka? Even with the compilation option `–-include-package-data=nbconvert` I’m still getting this error with the compiled executable:

`ImportError: cannot import name ‘PDFExporter’ from ‘nbconvert’`

The program works fine in Python, it only fails as an executable compiled with Nuitka (with `--onefile`).

Here’s a small example: [miek770/nbconvert-nuitka-test: Minimal example to test nbconvert’s PDFexporter with Nuitka](https://github.com/miek770/nbconvert-nuitka-test)

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [December 9, 2025, 12:23am UTC](https://discourse.jupyter.org/t/compiling-nbconvert-with-nuitka/38217/2 "2025-12-09T00:23:14Z")

</div>

Unfortunately, all of the PDF exporters have a significant heavyweight runtime dependency which may stymie approaches like `nuitika`.

The original, `PDFExporter`, depends on the few hundred megabytes of a full $LaTeX$ environment, and probably `pandoc`.

`WebPDFExporter` uses `playwright-python`, which needs a few hundred megabytes of browser downloaded, and maybe `nodejs` (I can never tell anymore).

Of them, `QtPDFExporter` has a _chance_ of working, but only just… it also uses a full, vendored chromium-derived browser, but qt is an important-enough dependency for standalone applications that someone may have already done some of the hard work.

---

<div class="post-metadata">

**Author:** ![miek770](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/miek770/32/21240_2.png) [@miek770](https://discourse.jupyter.org/u/miek770)\
**Post date:** [December 9, 2025, 1:03am UTC](https://discourse.jupyter.org/t/compiling-nbconvert-with-nuitka/38217/3 "2025-12-09T01:03:21Z")

</div>

I see, thank you! I’ll stick to my current solution: exporting to ipynb and letting users print to PDF from there.
