# Unable to properly build RCall

**URL:** <https://discourse.julialang.org/t/unable-to-properly-build-rcall/86078>\
**Category:** New to Julia\
**Tags:** r\
**Created:** [August 20, 2022, 8:56pm UTC](https://discourse.julialang.org/t/unable-to-properly-build-rcall/86078 "2022-08-20T20:56:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaportel](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@aaportel](https://discourse.julialang.org/u/aaportel)\
**Post date:** [August 20, 2022, 8:56pm UTC](https://discourse.julialang.org/t/unable-to-properly-build-rcall/86078/1 "2022-08-20T20:56:36Z")

</div>

I’m attempting to follow [these tutorials](https://github.com/JuliaAcademy/DataScience/blob/main/01.%20Data.ipynb), but when it comes time to add these packages:

```julia
BenchmarkTools
DataFrames
DelimitedFiles
CSV
XLSX
Downloads

```

I get into an error when trying to add the `RCall` dependancy. I try the following

```julia
ENV["R_HOME"] = ""
using Pkg
Pkg.add("RCall")
Pkg.build("RCall")

```

But it runs into the following error and stacktrace at `Pkg.add("RCall")`:

```julia
ERROR: Error building `RCall`: 
ERROR: LoadError: R_HOME is not a directory.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] top-level scope
   @ ~/.julia/packages/RCall/6kphM/deps/build.jl:53
 [3] include(fname::String)
   @ Base.MainInclude ./client.jl:451
 [4] top-level scope
   @ none:5
in expression starting at /home/aaportel/.julia/packages/RCall/6kphM/deps/build.jl:11
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Types.jl:68
  [2] (::Pkg.Operations.var"#62#67"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:962
  [3] withenv(::Pkg.Operations.var"#62#67"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String}})
    @ Base ./env.jl:172
  [4] (::Pkg.Operations.var"#99#103"{String, Bool, Bool, Bool, Pkg.Operations.var"#62#67"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1506
  [5] with_temp_env(fn::Pkg.Operations.var"#99#103"{String, Bool, Bool, Bool, Pkg.Operations.var"#62#67"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1390
  [6] (::Pkg.Operations.var"#98#102"{Bool, Bool, Bool, Pkg.Operations.var"#62#67"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1469
  [7] mktempdir(fn::Pkg.Operations.var"#98#102"{Bool, Bool, Bool, Pkg.Operations.var"#62#67"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:750
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem ./file.jl:748
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project; force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1435
 [10] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project)
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1432
 [11] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:943
 [12] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
    @ Pkg.Operations ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:822
 [13] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:992
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:149
 [15] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:144
 [16] #build#99
    @ ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
 [17] build
    @ ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
 [18] #build#98
    @ ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:141 [inlined]
 [19] build(pkg::String)
    @ Pkg.API ~/julia-1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:141
 [20] top-level scope
    @ REPL[7]:1

```

I then try

```julia
Pkg.add("Conda")
using Conda
Conda.add("R")
ENV["R_HOME"]="~/.julia/conda/3/bin/R" #location of conda R install

```

And try the previous steps again and get the same error.

Additional info:

- running on 1.7.3 [(link)](https://julialang.org/downloads/oldreleases/) [(direct download)](https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.3-linux-x86_64.tar.gz)
- not a conda install, nor is there a conda base environment
- operating system is debian based

Thanks for any help y’all can give this tired soul

---

<div class="post-metadata">

**Author:** ![aaportel](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@aaportel](https://discourse.julialang.org/u/aaportel)\
**Post date:** [August 20, 2022, 10:45pm UTC](https://discourse.julialang.org/t/unable-to-properly-build-rcall/86078/2 "2022-08-20T22:45:36Z")

</div>

I figured out the issue. It was a matter of finding the home directory of R, not the R exec itself.

`ENV["R_HOME"]="/home/aaportel/.julia/conda/3/lib/R"`
