Loading setup script for JuliaCall in R not working

Hi everybody,

I managed to successfully install Julia on my Ubuntu machine into a specific folder. Path to the Julia bin is

/home/clement/Julia_download/julia-1.5.3/bin 

Now, the goal is to call or run julia in R. I have installed the package “JuliaCall”. But when I run either of the following I get an error message since the julia_setup path cannot load properly. If I run either:

julia_setup
or

julia_setup(JULIA_HOME = "/home/clement/Julia_download/julia-1.5.3/bin")

or

or any function like

julia_command("a = sqrt(2);"); julia_eval("a")

I get this error message :disappointed:

Julia version 1.5.3 at location /home/clement/Julia_download/julia-1.5.3/bin will be used.
Loading setup script for JuliaCall...
WARNING: replacing module JuliaCall.
LoadError("/home/clement/R/x86_64-pc-linux-gnu-library/3.6/JuliaCall/julia/setup.jl", 63, ArgumentError("Package Suppressor not found in current path:\n- Run `import Pkg; Pkg.add(\"Suppressor\")` to install the Suppressor package.\n")) Error in .julia$cmd(paste0("Base.include(Main,\"", system.file("julia/setup.jl",  :
 Error happens when you try to execute command Base.include(Main,"/home/clement/R/x86_64-pc-linux-gnu-library/3.6/JuliaCall/julia/setup.jl") in Julia.
                       To have more helpful error messages,
                       you could considering running the command in Julia directly
In addition: Warning message:
In system2(file.path(.julia$bin_dir, "julia"), shQuote(command),  :
 running command ''/home/clement/Julia_download/julia-1.5.3/bin/julia' '--startup-file=no' '/home/clement/R/x86_64-pc-linux-gnu-library/3.6/JuliaCall/julia/install_dependency.jl' '/usr/lib/R' 2>&1' had status 1

Main Question: Is there any way I can solve this problem to be able to use or call Julia commands in R? I have already installed the package JuliaCall but the setup script for JuliaCall cannot load properly. Thus, any Julia function I call in R is basically not working.

It seems that somehow the needed Julia package Suppressor wasn’t installed.
You may try to open your Julia REPL and add the package manually:

using Pkg; Pkg.add("Suppressor")

and afterwards try again with R.

Thanks for the response. Unfortunately, I tried installing Julia package Suppressor, but it’s not working in Julia REPL. This is the error message that comes up:

ERROR: SystemError: opening file "/home/clement/.julia/registries/General/Registry.toml": No such file or directory
Stacktrace:
 [1] systemerror(::String, ::Int32; extrainfo::Nothing) at ./error.jl:168
 [2] #systemerror#48 at ./error.jl:167 [inlined]
 [3] systemerror at ./error.jl:167 [inlined]
 [4] open(::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at ./iostream.jl:284

ok, something wrong. Please try

using Pkg
Pkg.instantiate()
Pkg.add("Suppressor")

The same error popped up after running this:

using Pkg
Pkg.instantiate()
Pkg.add("Suppressor")

That’s the same error message, unfortunately.

ERROR: SystemError: opening file "/home/clement/.julia/registries/General/Registry.toml": No such file or directory
Stacktrace:
 [1] systemerror(::String, ::Int32; extrainfo::Nothing) at ./error.jl:168
 [2] #systemerror#48 at ./error.jl:167 [inlined]
 [3] systemerror at ./error.jl:167 [inlined]
 [4] open(::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at ./iostream.jl:284

The new error message is similar to those: Registry.toml missing - Usage / First steps - JuliaLang, and “.julia/registries/General/Registry.toml”: No such file or directory · Issue #37521 · JuliaLang/julia (github.com) .
From the information in the linked post and Github issue, deleting “/home/clement/.julia/registries/General/” may solve the problem.
After deleting the folder, try

using Pkg; Pkg.add("Suppressor"); Pkg.add("RCall"); 
using Suppressor; using RCall;

in julia. If everything works, then restart R and try again.

2 Likes

Thank you very much. It’s working perfectly fine now after deleting General within registries. My JuliaCall in R is working now @Non-Contradiction