Sphere
Log in Join
☆ 7

quarto render fails with vscode and python venv

Quarto 1.4.5 in VS Code, Python 3.11 in a local venv (.venv). quarto render report.qmd works from the terminal where I activated the venv, but when I hit the Render button in VS Code it uses a different Python (3.10 system) and fails with 'ModuleNotFoundError: No module named pandas'. I've set the interpreter in VS Code to the venv. Do I need to configure Quarto to use the same Python? Is there a _quarto.yml setting or environment variable? Also is there a way to make the render reproducible so a teammate gets the same environment?

⚑ Report

4 replies

☆ 0
S seg ·2026-11-10#1

Quarto uses the Jupyter kernel, not VS Code's interpreter directly. Check jupyter kernelspec list - your venv probably isn't registered as a kernel. Register it: .venv/bin/python -m ipykernel install --user --name myreport --display-name 'Python (report venv)', then in the QMD YAML set jupyter: myreport. That makes Quarto use the venv regardless of how you launch it. VS Code's Render button then picks the kernel from the YAML.

⚑ Report
☆ 0
C cron ·2026-11-12#2

That's it - no kernel for the venv. Registered it with ipykernel and set jupyter: myreport in the YAML. Render works from both terminal and VS Code now. For reproducibility, is there a way to pin the kernel so a teammate's Quarto uses theirs? And should I commit the venv or use a requirements.txt?

⚑ Report
☆ 0
T tabz ·2026-11-13#3

Don't commit the venv - commit a requirements.txt or lock file and a README with the one-line setup (create venv, pip install -r requirements.txt, register ipykernel). For the kernel name, each teammate registers their own venv under the same --name myreport, so the YAML stays the same. For stronger reproducibility look at uv or conda with an environment lock. Also quarto check jupyter is handy to see which kernel Quarto will grab.

⚑ Report
☆ 0
P ptr ·2026-11-16#4

Registered the kernel, YAML set, added requirements.txt and a setup line in the README. The trick was realizing Quarto goes through Jupyter, not the VS Code interpreter. quarto check jupyter confirmed it. Now anyone can clone the repo, run the setup, and render the same report. Small thing but it unblocked the whole team.

⚑ Report
Log in to reply.