Code Monkey home page Code Monkey logo

Comments (6)

palday avatar palday commented on August 18, 2024

Instead of using the ~, can you use the full path? ~ is something that Bash provides and it's not necessarily recognized at the file system level. Looking at the rest of your error message, you need something like

julia> ENV["R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R"

from rcall.jl.

isaamael avatar isaamael commented on August 18, 2024

Dear Developer, @palday
Firstly, I apologize for the late reply, I’ve been tied up with too many trivial matters!
I tried the method you suggested, however, the same error still appears.

[xuruiqiang@login2 ~]$ source ~/miniconda3/bin/activate RTIGER
(RTIGER) [xuruiqiang@login2 ~]$ R RHOME
/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R
(RTIGER) [xuruiqiang@login2 ~]$ which R
~/miniconda3/envs/RTIGER/bin/R
(RTIGER) [xuruiqiang@login2 ~]$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.0 (2020-03-21)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> ENV["R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R"
"/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R"

julia> ENV["JULIA_R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/bin/R"
"/public/home/xuruiqiang/miniconda3/envs/RTIGER/bin/R"

julia> using Pkg

julia> Pkg.build(PackageSpec(name="RCall", version="0.13.6"))
   Building Conda → `~/.julia/packages/Conda/sDjAP/deps/build.log`
   Building RCall → `~/.julia/packages/RCall/ffM0W/deps/build.log`
┌ Error: Error building `RCall`: 
│ ERROR: LoadError: R cannot be found. Set the "R_HOME" environment variable to re-run Pkg.build("RCall").
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] top-level scope at /public/home/xuruiqiang/.julia/packages/RCall/ffM0W/deps/build.jl:47
│  [3] include(::String) at ./client.jl:439
│  [4] top-level scope at none:5
│ in expression starting at /public/home/xuruiqiang/.julia/packages/RCall/ffM0W/deps/build.jl:10
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:892

In addition, I also tried several other methods, all to no avail.
As you can see, R is in the conda environment, and Julia is in the system environment variables. I need to install RCall in Julia in order to use a specific R package.
I don’t know if you can provide any other suggestions to help identify where the problem lies and how to solve it.
Please forgive me as a programming novice and Julia newbie.
Any advice is needed !

from rcall.jl.

palday avatar palday commented on August 18, 2024

What happens if you do

ENV["R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/bin/R"
using Pkg
Pkg.build(PackageSpec(name="RCall", version="0.13.6"))

?

from rcall.jl.

isaamael avatar isaamael commented on August 18, 2024

emmm......it dose not work

julia> ENV["R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/bin/R"
"/public/home/xuruiqiang/miniconda3/envs/RTIGER/bin/R"
julia> using Pkg
julia> Pkg.build(PackageSpec(name="RCall", version="0.13.6"))
   Building Conda → `~/.julia/packages/Conda/sDjAP/deps/build.log`
   Building RCall → `~/.julia/packages/RCall/ffM0W/deps/build.log`
┌ Error: Error building `RCall`: 
│ ERROR: LoadError: R_HOME is not a directory.
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] top-level scope at /public/home/xuruiqiang/.julia/packages/RCall/ffM0W/deps/build.jl:42
│  [3] include(::String) at ./client.jl:439
│  [4] top-level scope at none:5
│ in expression starting at /public/home/xuruiqiang/.julia/packages/RCall/ffM0W/deps/build.jl:10
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:892

Any chance it's a problem with the julia install?

from rcall.jl.

palday avatar palday commented on August 18, 2024

One more idea:

(RTIGER) [xuruiqiang@login2 ~]$ LD_LIBRARY_PATH="/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R/lib/:$LD_LIBRARY_PATH" julia
julia> ENV["R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R"
julia> using Pkg
julia> Pkg.build(PackageSpec(name="RCall", version="0.13.6"))

from rcall.jl.

isaamael avatar isaamael commented on August 18, 2024

still erro.

(RTIGER) [xuruiqiang@login2 julia-1.4.0]$ LD_LIBRARY_PATH="/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R/lib/:$LD_LIBRARY_PATH" julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.0 (2020-03-21)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> ENV["R_HOME"] = "/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R"
"/public/home/xuruiqiang/miniconda3/envs/RTIGER/lib/R"

julia> using Pkg

julia> Pkg.build(PackageSpec(name="RCall", version="0.13.6"))
   Building Conda → `~/.julia/packages/Conda/sDjAP/deps/build.log`
   Building RCall → `~/.julia/packages/RCall/ffM0W/deps/build.log`
┌ Error: Error building `RCall`: 
│ ERROR: LoadError: R cannot be found. Set the "R_HOME" environment variable to re-run Pkg.build("RCall").
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] top-level scope at /public/home/xuruiqiang/.julia/packages/RCall/ffM0W/deps/build.jl:47
│  [3] include(::String) at ./client.jl:439
│  [4] top-level scope at none:5
in expression starting at /public/home/xuruiqiang/.julia/packages/RCall/ffM0W/deps/build.jl:10
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:892

from rcall.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.