# Tell julia where R is

**URL:** <https://discourse.julialang.org/t/tell-julia-where-r-is/78499>\
**Category:** General Usage\
**Tags:** statistics\
**Created:** [March 26, 2022, 3:20am UTC](https://discourse.julialang.org/t/tell-julia-where-r-is/78499 "2022-03-26T03:20:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wub7quxa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wub7quxa/32/33473_2.png) [@wub7quxa](https://discourse.julialang.org/u/wub7quxa)\
**Post date:** [March 26, 2022, 3:20am UTC](https://discourse.julialang.org/t/tell-julia-where-r-is/78499/1 "2022-03-26T03:20:36Z")

</div>

I run Julia in Jupyter on AWS Amazon SageMaker, where it is installed using anaconda. R Jupyter notebooks work as well, so clearly R is installed. “add RCall” in Julia’s package manager succeeds. But when I do “using RCall” in julia, I get

ERROR: LoadError: RCall not properly installed. Please run Pkg.build(“RCall”)

When I run Pkg.build(“RCall”) in Julia, I get

ERROR: LoadError: Could not find library /usr/local/lib64/R/lib/libR.so. Make sure that R shared library exists.

Because of anaconda, R is installed in a different environment than Julia. How do I tell Julia where R is? I tried installing R from source, but that turns out to be quite tricky; and it really should be unnecessary, as R already runs perfectly well in its own anaconda environment. If I do conda info --envs I get, among others, R and JupyterSystemEnv.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [March 26, 2022, 3:59am UTC](https://discourse.julialang.org/t/tell-julia-where-r-is/78499/2 "2022-03-26T03:59:58Z")

</div>

Does this help?  
[https://juliainterop.github.io/RCall.jl/stable/installation/](https://juliainterop.github.io/RCall.jl/stable/installation/)  
It recommends setting:

```julia
ENV["R_HOME"] = "....directory of R home...."
Pkg.build("RCall")

```

---

<div class="post-metadata">

**Author:** ![wub7quxa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wub7quxa/32/33473_2.png) [@wub7quxa](https://discourse.julialang.org/u/wub7quxa)\
**Post date:** [March 26, 2022, 5:27am UTC](https://discourse.julialang.org/t/tell-julia-where-r-is/78499/3 "2022-03-26T05:27:46Z")

</div>

> [@jd-foster](#):
>
> `Pkg.build("RCall")`

That was it! Awesome! Thanks!!
