From 654cd7db9fb030c31ee076105cce1e8d70ac565e Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 2 Jun 2026 11:39:48 +0000 Subject: [PATCH] Fix Quarto Jupyter engine: install PyYAML Quarto's own jupyter wrapper (/opt/quarto/share/jupyter/jupyter.py -> notebook.py) does 'from yaml import safe_load', so executing a {python} cell failed with ModuleNotFoundError: No module named 'yaml'. The minimal jupyter stack didn't pull PyYAML in (psutil/ipython already come via ipykernel), so add pyyaml explicitly. Co-Authored-By: Claude Opus 4.8 --- server-ce/Dockerfile-base | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server-ce/Dockerfile-base b/server-ce/Dockerfile-base index 9c435f4564..c38dd498e2 100644 --- a/server-ce/Dockerfile-base +++ b/server-ce/Dockerfile-base @@ -74,7 +74,8 @@ RUN mkdir -p /opt/quarto-extensions \ # Quarto runs ```{python}``` cells through a Jupyter kernel. It uses the system # python3 it detected (/usr/bin/python3), so Jupyter must be installed there. # We install only the headless execution stack Quarto needs (jupyter-client + -# nbclient/nbformat + the ipykernel kernel), not the notebook/lab servers, and +# nbclient/nbformat + the ipykernel kernel + pyyaml, which Quarto's own +# /opt/quarto/share/jupyter wrapper imports), not the notebook/lab servers, and # register a system-wide "python3" kernelspec under /usr/local/share/jupyter so # it is discoverable regardless of HOME/XDG. Noble's Python is externally # managed (PEP 668), hence --break-system-packages in this controlled image. @@ -83,7 +84,7 @@ RUN mkdir -p /opt/quarto-extensions \ RUN apt-get update \ && apt-get install -y python3-pip \ && pip3 install --no-cache-dir --break-system-packages \ - jupyter-core jupyter-client nbclient nbformat ipykernel \ + jupyter-core jupyter-client nbclient nbformat ipykernel pyyaml \ && python3 -m ipykernel install --prefix /usr/local --name python3 --display-name "Python 3" \ # Bundle the common scientific-Python stack so most decks "just work" without # any per-project install. matplotlib renders headless (Agg) automatically.