Open rleyvasal opened 1 year ago
Ah, this is an interesting one. The issue here is that when we execute the python code ourselves in quarto (through --execute
), we set up the environment so that it contains ojs_define
. But if you attempt to run it in VS Code or jupyter notebook, then those won't have access to that ojs_define
call.
The only way to solve this in general is for us to have an explicit Python API for quarto. We don't have one right now (because we want to design something that looks uniform across different languages, and so the problem is bigger than just Python), but I think this is enough of a use case for us to have to think this through.
In the meantime, the workaround is for you to call quarto render ojs_jupyter.ipynb --execute
.
Also interested in a neat solution to this 🙂 Naive to the practicalities, but could ojs_define live in the ojs block?
Bug description
Os: Ubuntu 22.04 VScode: 1.72.2 Quarto: 1.1.251 Quarto VScode extension: v1.51.0
I am following the example in the quarto docs to bring a pandas dataframe to OJS in Jupyter notebook but I get error
'ojs_define' is not defined
ojs_jupyter.zip
Checklist