Fail to precompile RCall package after installation

Viewed 171
julia> using RCall
[ Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]
ERROR: LoadError: RCall not properly installed. Please run Pkg.build("RCall")
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] top-level scope at C:\Users\nicho\.julia\packages\RCall\eRsxl\src\RCall.jl:36
 [3] include(::Function, ::Module, ::String) at .\Base.jl:380
 [4] include(::Module, ::String) at .\Base.jl:368
 [5] top-level scope at none:2
 [6] eval at .\boot.jl:331 [inlined]
 [7] eval(::Expr) at .\client.jl:467
 [8] top-level scope at .\none:3
in expression starting at C:\Users\nicho\.julia\packages\RCall\eRsxl\src\RCall.jl:33
ERROR: Failed to precompile RCall [6f49c342-dc21-5d91-9882-a32aef131414] to C:\Users\nicho\.julia\compiled\v1.5\RCall\8GFyb_RACSn.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
 [3] _require(::Base.PkgId) at .\loading.jl:1030
 [4] require(::Base.PkgId) at .\loading.jl:928
 [5] require(::Module, ::Symbol) at .\loading.jl:923

Set the "R_HOME" environment variable and package installed, but precompiling didn't work correctly.

1 Answers

You need to build RCall after setting the R_HOME not just recompile it. Please also note that R_HOME should point to a R installation location rather than the executable.

Hence, the correct commands could look like this:

ENV["R_HOME"]="/your/R/installation/directory/path"
using Pkg
Pkg.build("RCall")
using RCall
Related