Introduction
Interactive coding in R and Python is made possible with Quarto Live
, which leverages WebAssembly-powered engines such as webR
and Pyodide
. In this guide, you’ll learn how to install Quarto Live and configure these engines to enable real-time, hands-on programming in your browser.
Interactive coding provides immediate feedback, dynamic visualizations, and an engaging learning experience—without the need for a server. Follow these steps to get started.
Step 1: Installing Quarto Live
Open your terminal within the Quarto project directory and run the following command:
quarto add r-wasm/quarto-live
This command installs the Quarto Live extension along with all required dependencies to support WebAssembly-based execution.
Step 2: Configuring Your Document
To use Quarto Live
in your documents, update your Quarto document’s YAML front matter. For example:
---
format: live-html
engine: knitr
---
If you’re using the knitr
engine for R, include the setup code snippet to load the WebAssembly engine:
---
format: live-html
engine: knitr
---
{{< include ./_extensions/r-wasm/live/_knitr.qmd >}}
Including _knitr.qmd
is not strictly required if you are using the jupyter
rendering engine. It is a temporary requirement for the knitr
engine and will be removed in a future release of quarto-live
.
Step 3: Verifying Your Setup
Create a new interactive document with a simple code block to verify that your installation works correctly. For example, in an R code cell:
Running these code blocks should immediately display the output in your browser. If you see the expected results, your setup is complete!
Troubleshooting Tips
Engine Loading Issues:
Ensure your internet connection is stable, as the WebAssembly engines are downloaded at runtime.Command Errors:
Verify that you’re running the installation command within the correct Quarto project directory.Configuration Problems:
Double-check your YAML front matter for syntax errors or missing fields.
If you encounter further issues, consult the troubleshooting guide for additional support.
Conclusion
By following these steps, you have successfully installed Quarto Live and configured the WebAssembly engines for interactive R and Python programming. You’re now ready to explore interactive code blocks, dynamic visualizations, and engaging coding exercises.
Feel free to revisit this guide as needed, and continue exploring other topics in the Getting Started folder.
Further Reading
Interactive Code Blocks Explained
Learn how to create and run interactive code blocks using thewebr
andpyodide
engines.
Read moreLoading and Using Packages
Discover how to install and load additional R and Python packages, both at document startup and interactively.
Read moreManaging Execution Environments
Understand how to share variables across code blocks or isolate interactive exercises by managing your execution environments.
Read moreCell Options Reference
For advanced configuration details, refer to the comprehensive guide on interactive cell options available in Quarto Live.
Read moreTroubleshooting Interactive Documents
If you run into issues during installation or configuration, check out our troubleshooting guide for common problems and solutions.
Read more
Explore More Articles
Here are more articles from the same category to help you dive deeper into the topic.
Reuse
Citation
@online{kassambara2025,
author = {Kassambara, Alboukadel},
title = {Installing {Quarto} {Live} \& {WebAssembly} {Engines}},
date = {2025-03-07},
url = {https://www.datanovia.com/learn/interactive/getting-started/installation.html},
langid = {en}
}