Quarto (using R & Julia)

I have previously been able to render quarto (https://quarto.org/) notebooks that contain R, Python and Julia code chunks.
However, since updating to Julia 1.9 (and since using juliaup) I am now getting errors when trying to render .qmd files that previously worked fine.

See the error message attached, which I think is regarding the R library, "JuliaCall" - I included the yaml header in case that is useful.

Error in .julia$cmd():
! Error happens when you try to execute command ENV["R_HOME"] = "/Library/Frameworks/R.framework/Resources";Base.include(Main,"/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/JuliaCall/julia/setup.jl") in Julia.

is there something I need to change in setup.jl? Or does juliaup give me a new setup.jl file that ENV["R_HOME"] isn't being set to?

Any help would be much appreciated!


Can you share the qmd source that reproduce the issue ?

From your screenshot, I don't understand if you are planning to use Quarto with Jupyter or knitr.

Setting jupyter key under html is not working possibly. It needs to be set differently if you plan to use jupyter; See Quarto - Execution Options

But if you are trying to set Julia as Jupyter engine, why not use Julia chunk ? Quarto - Using Julia

It would be helpful to understand how your document is working. Especially the one that was working for you before - it would allow us to try on our side.

Maybe something as changed in Julia 1.9 and some adaptation are required in JuliaCall R package.
But if you are using Jupyter engine, then things are probably different

Hi @cderv - thank you for your reply.

unfortunately, this site does not allow me to attach .qmd files.

However, I have attached an image of a very minimal .qmd file, which also produces this error:

Full error message:
Loading setup script for JuliaCall...
LoadError("/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/JuliaCall/julia/setup.jl", 16, InitError(:Rmath_jll, ErrorException("could not load library "/Users/ddifrancesco/.julia/artifacts/d779ae56a8eaabc3dc8e0f2ab17907389b96d155/lib/libRmath-julia.dylib"\ndlopen(/Users/ddifrancesco/.julia/artifacts/d779ae56a8eaabc3dc8e0f2ab17907389b96d155/lib/libRmath-julia.dylib, 0x0001): Library not loaded: /workspace/destdir/x86_64-apple-darwin14/lib/libgcc_s.1.dylib\n Referenced from: /Users/ddifrancesco/.julia/artifacts/d779ae56a8eaabc3dc8e0f2ab17907389b96d155/lib/libRmath-julia.dylib\n Reason: tried: '/workspace/destdir/x86_64-apple-darwin14/lib/libgcc_s.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/x86_64-apple-darwin14/lib/libgcc_s.1.dylib' (no such file), '/workspace/destdir/x86_64-apple-darwin14/lib/libgcc_s.1.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libgcc_s.1.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-11.0.18+10/Contents/Home/lib/server/libgcc_s.1.dylib' (no such file)")))
Quitting from lines 18-20 [unnamed-chunk-2] (DCE_new.qmd)
Error in .julia$cmd():
! Error happens when you try to execute command ENV["R_HOME"] = "/Library/Frameworks/R.framework/Resources";Base.include(Main,"/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/JuliaCall/julia/setup.jl") in Julia.
To have more helpful error messages,
you could considering running the command in Julia directly

  1. global .main()
  2. execute(...)
  3. rmarkdown::render(...)
  4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  5. knitr:::process_file(text, output)
  6. knitr:::block_exec(params)
  7. knitr (local) engine(options)
  8. JuliaCall::eng_juliacall(options)
  9. JuliaCall::julia_setup()
  10. .julia$cmd(...)
    Execution halted
    Julia exit.

Here is a link to a workaround I have found: julia_setup() cannot find libgcc_s.1.dylib from a juliaup installation, within Quarto · Issue #207 · Non-Contradiction/JuliaCall · GitHub

The R package JuliaCall may need to be updated to fully address this issue, but I'm leaving this here incase it helps. Thanks everyone for your time and input!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Glad you found the problem

FYI .qmd is text file. You can insert code content directly

FAQ: How to Format R Markdown Source