Skip to content

pdf export using webpdf fails #9713

Closed

Description

@vascotenner

Describe the bug

When trying to export to PDF it gives the following error. How to solve? How to even debug?

> marimo export pdf .\test.py -o out.pdf
Exporting PDF: executing notebook...
Exporting PDF: notebook execution finished.
Exporting PDF: serializing notebook for PDF rendering...
Exporting PDF: rendering PDF via WebPDF...
Task exception was never retrieved
future: <Task finished name='Task-4' coro=<Connection.run() done, defined at C:\Users\user\.virtualenvs\marimo\Lib\site-packages\playwright\_impl\_connection.py:305> exception=NotImplementedError()>
Traceback (most recent call last):
  File "C:\Users\user\.virtualenvs\marimo\Lib\site-packages\playwright\_impl\_connection.py", line 312, in run
    await self._transport.connect()
  File "C:\Users\user\.virtualenvs\marimo\Lib\site-packages\playwright\_impl\_transport.py", line 133, in connect
    raise exc
  File "C:\Users\user\.virtualenvs\marimo\Lib\site-packages\playwright\_impl\_transport.py", line 120, in connect
    self._proc = await asyncio.create_subprocess_exec(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    )
    ^
  File "C:\Users\user\AppData\Local\Programs\Python\Python314\Lib\asyncio\subprocess.py", line 224, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        stderr=stderr, **kwds)
        ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python314\Lib\asyncio\base_events.py", line 1798, in subprocess_exec
    transport = await self._make_subprocess_transport(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        protocol, popen_args, False, stdin, stdout, stderr,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        bufsize, **kwargs)
        ^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python314\Lib\asyncio\base_events.py", line 533, in _make_subprocess_transport
    raise NotImplementedError
NotImplementedError
Error: Failed to export PDF:

Will you submit a PR?

  • Yes

Environment

Details
{
  "marimo": "0.23.8",
  "editable": false,
  "location": "C:/Users/user/.virtualenvs/marimo/Lib/site-packages/marimo",
  "OS": "Windows",
  "OS Version": "11",
  "Processor": "Intel64 Family 6 Model 186 Stepping 2, GenuineIntel",
  "Python Version": "3.14.0",
  "Locale": "--",
  "Binaries": {
    "Browser": "--",
    "Node": "--",
    "uv": "--"
  },
  "Dependencies": {
    "click": "8.3.1",
    "docutils": "0.22.4",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.10.2",
    "narwhals": "2.18.1",
    "packaging": "26.0",
    "psutil": "7.2.2",
    "pygments": "2.20.0",
    "pymdown-extensions": "10.21.2",
    "pyyaml": "6.0.3",
    "starlette": "1.0.0",
    "tomlkit": "0.14.0",
    "typing-extensions": "4.15.0",
    "uvicorn": "0.42.0",
    "websockets": "16.0"
  },
  "Optional Dependencies": {
    "altair": "6.1.0",
    "anywidget": "0.11.0",
    "loro": "1.10.3",
    "nbformat": "5.10.4",
    "pandas": "3.0.3",
    "polars": "1.39.3",
    "pytest": "9.0.3",
    "ruff": "0.15.10"
  },
  "Experimental Flags": {}
}

Code to reproduce

No response

Activity

  1. added theissue type on May 28, 2026
  2. akshayka commented on May 28, 2026

    @akshayka
    Contributor

    Hi @vascotenner, thank you for reporting. It looks like this is an incompatibility with our PDF export on Windows.

    We will look into fixing this.

    In the meantime, here are some workarounds:

    1. Can you try: marimo export pdf --no-webpdf .\test.py -o out.pdf? This will require you to install Pandoc/LaTeX, but may be more reliable.
    2. If (1) is not a possibility, can you try to use Python 3.13 instead of 3.14?
  3. akshayka commented on May 28, 2026

    @akshayka
    Contributor

    I believe a fix would be along the lines of #9194

  4. akshayka commented on May 28, 2026

    @akshayka
    Contributor

    Here is the upstream issue: jupyter/nbconvert#2287

  5. Yasin197 commented on May 28, 2026

    @Yasin197

    I've seen this error message too in the past

  6. added a commit that references this issue on Jul 10, 2026
    0af89ee
  7. vascotenner commented on Jul 21, 2026

    @vascotenner
    Author

    I tested this by creating a new envirment using uv: uv venv --python 3.14.6
    I can now export document that do NOT contain marimo widgets.

    What not works is when I include an accordion:
    mo.accordion({'a': 'Test'})

    Same error as above (only different path to python).

    So the issue is not solved for me. (neither works with python 3.13)

  8. added a commit that references this issue on Sep 6, 2026
    148eef3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions