I have some issues getting Quarto and IJulia to work on my computer (Linux Mint) and standard tips don’t seem to work. What happens is the following:
Trying to render a Quarto notebook results in the following error message:
➜ examples git:(main) ✗ quarto render RayleighQuotient.qmd
Starting julia-1.10 kernel...Traceback (most recent call last):
File "/opt/quarto/share/jupyter/jupyter.py", line 21, in <module>
from notebook import notebook_execute, RestartKernel
File "/opt/quarto/share/jupyter/notebook.py", line 14, in <module>
from yaml import safe_load
ModuleNotFoundError: No module named 'yaml'
Trying to directly run the .ipynb notebook results in
ERROR: LoadError: ArgumentError: Package IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] is required but does not seem to be installed:
- Run `Pkg.instantiate()` to install all recorded dependencies.
but IJulia is installed and built (re-tried multiple times…)
3. .ipynb notebooks do work in VSCode but through its extension magic.
4. Ideally I’d like the notebook to be rendered with Julia’s Conda but it’s really hard to even figure out which Python is actually used by Quarto or jupyter-notebook.
5. It used to work perfectly fine before I upgraded from Julia 1.9 to 1.10.
Do you have any tips? I’ve spent a couple of hours trying to fix it and this is basically my last attempt before giving up.
It didn’t work, still the No module named 'yaml' problem no matter how I try to run it. I’m not even sure which Python environment is supposed to have yaml. Both the system one and the Julia-Conda one have it.
It isn’t a great solution, but you might get something going if you set the jupyter value in your _quarto.yml file (or your header). I have something like this to force 1.10, you might use 1.9:
Thanks, this post was really helpful. It turns out that my Julia has two separate conda environments for some reason and only one of them had pyyaml. For reference, one was in /.julia/environments/v1.10/.CondaPkg/env, the other one in .julia/conda/3/bin/. I don’t know how that happened but maybe it will help someone fix it in the future.
Indeed this looks like another instance of “Python hell”. You wrote in your initial post that " it’s really hard to even figure out which Python is actually used by Quarto". But in these situations you can use quarto check and you will get at least some diagnostics. Furthermore, through QUARTO_PYTHON you can set the path to the Python you want.
That’s a great tip. My solution was to add pyyaml to all three of my Python3.x distributions (mamba, homebrew, Julia conda) . Eventually got it working, but was too lazy to isolate which one quarto was actually using.