Python set up with Quarto

Python
Quarto

Use Python with Quarto

Author

Chi Zhang

Published

November 29, 2024

Pre-requisite

  • Need to enter the virtual environment of your choosing. In RStudio, select the one you need inside Tools -> Global Options -> Python -> Interpreter -> Virtual Environment
  • Need PyYaml installed in this virtual environment. Try to run pip install pyyaml inside the virtualenv.
  • Need to set the engine as such,
---
title: "test python"
format: html
jupyter: python3
---

Afterwards, can try to render

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()

To check what packages are installed, can use pip list.