Closed jason-xuan closed 5 years ago
Thank you for the feedback. What is the result of using RCall
in Julia?
It works, but at first I need to rebuild it, it seems that the j <- julia_setup()
function damages the RCall package
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\zjxua\.julia\packages\RCall\RPlFw\src\RCall.jl:34
[3] include at .\boot.jl:317 [inlined]
[4] include_relative(::Module, ::String) at .\loading.jl:1044
[5] include(::Module, ::String) at .\sysimg.jl:29
[6] top-level scope at none:2
[7] eval at .\boot.jl:319 [inlined]
[8] eval(::Expr) at .\client.jl:393
[9] top-level scope at .\none:3
in expression starting at C:\Users\zjxua\.julia\packages\RCall\RPlFw\src\RCall.jl:31
ERROR: Failed to precompile RCall [6f49c342-dc21-5d91-9882-a32aef131414] to C:\Users\zjxua\.julia\compiled\v1.0\RCall\8GFyb.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1203
[3] _require(::Base.PkgId) at .\loading.jl:960
[4] require(::Base.PkgId) at .\loading.jl:858
[5] require(::Module, ::Symbol) at .\loading.jl:853
julia> using Pkg
julia> Pkg.build("RCall")
Building CodecZlib → `C:\Users\zjxua\.julia\packages\CodecZlib\DAjXH\deps\build.log`
Building Conda ────→ `C:\Users\zjxua\.julia\packages\Conda\uQitS\deps\build.log`
Building RCall ────→ `C:\Users\zjxua\.julia\packages\RCall\RPlFw\deps\build.log`
julia> using RCall
[ Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]
julia> z = 1
1
julia> @rput z
1
R> z
[1] 1
R> rnorm(10)
[1] -1.5466842 -1.0761188 1.0797469 0.2911725 -2.1343276 -0.1167468
[7] 2.1759966 -0.7001125 2.2242575 0.8921539
julia> R"rnorm(10)"
RObject{RealSxp}
[1] 0.29118249 0.44693269 1.02731955 -0.83262039 -0.41408416 1.00665726
[7] 0.60336981 -0.01557677 1.02081239 -0.96174732
julia>
That seems interesting... What is the result of RCall.Rhome
? If the result matches R.home()
in R, then it seems that julia_setup()
should also work.
Actually, they are the same... They are supposed to work but actually don't.
Are they exactly the same? For example, if RCall.Rhome
and R.home()
are in Windows short form and full form, they represent the same file but are not exactly the same, then JuliaCall
will try to build the RCall
again, which somehow break the RCall
installation...
Well... I don't know if this is what you mean, but yes, the "string" is not exactly the same but indicating the same address. But it's not the short form and full form, but about Backslash.
julia> RCall.Rhome
"C:\\PROGRA~1\\R\\R-35~1.2"
> R.home()
[1] "C:/PROGRA~1/R/R-35~1.2"
I'm still thinking about why the error happens. But one thing to try is to use julia_setup(install = FALSE)
to skip the installation of RCall.jl
and Suppressor.jl
by JuliaCall
. This should work fine with RCall
and Suppressor
already installed and set up correctly, and by install = FALSE
, JuliaCall
will just use the packages already installed and won't mess up with them.
thanks! julia_setup(install = FALSE)
works for me.
Sorry to re-open this issue, but I have the same issue, and unfortunately julia_setup(install = FALSE) didn't work for me.
I have Julia 1.1.1, and R 3.6.1.
When I call julia <- julia_setup(install = FALSE)
, it returns an error (same as with julia_setup(install = FALSE)
):
Julia version 1.1.1 at location C:\Users\vezy\AppData\Local\JuliaPro-1.1.1.1\Julia-1.1.1\bin will be used.
Loading setup script for JuliaCall...
Error in .julia$cmd(paste0("Base.include(Main,\"", system.file("julia/setup.jl", :
Error happens when you try to execute command Base.include(Main,"D:/Mes Donnees/R/win-library/3.6/JuliaCall/julia/setup.jl") in Julia.
To have more helpful error messages,
you could considering running the command in Julia directly
I installed manually RCall and Suppressor in julia, and both installations worked. I also tested RCall and it works perfectly.
If I include setup.jl
from Julia, it works, i.e.:
Base.include(Main,"D:/Mes Donnees/R/win-library/3.6/JuliaCall/julia/setup.jl")
I'm on windows too, and the path to the r home is similar (different format though):
julia> RCall.Rhome
"C:\\Program Files\\R\\R-3.6.1"
R> R.home()
[1] "C:/Program Files/R/R-3.6.1"
Any suggestions ?
It is a little strange to have RCall and Suppressor work perfectly and setup.jl also works in Julia but the same loading script fails in JuliaCall. But JuliaPro is not tested thoroughly, so the problem may be with JuliaPro? Is it convenient for you to check if the same problem can be reproduced on ordinary Julia? I will also try to test JuliaPro probably within two or three days.
Installing the package directly from julia worked ! And actually I was using VS Code, but the path to Julia is the one from JuliaPro-1.1.1.1 because I installed JuliaPro before, so I linked VS Code to this installation to avoid having several Julia exe.
Thank you very much !
Thanks for the feedback! I just added a commit which deals with "\" and "/" in paths. So this kind of problem should be solved.
I installed the package and tried to run the
julia_setup()
function, but it failed, showed me the command and suggested me to run it in the Julia REPL. I rebuilt the package and run the command, it worked. But when I switched back to R, it failed again. I don't understand what purpose the setup function is. Is there any workaround?