2

I have some problems with using R and Rstdio along with my Jupyter notebook and r in my ubuntu 20.04. I first installed R and Rstudio. This version of R was the latest. (4.0.5). Then I installed conda with the R environment. (This version of R is 3.2.2). after this the Rstudio-Desktop crashed and required libreadline.so.6. which I did by creating a symlink as suggested in libreadline.so.6 issues in ubuntu 18.04.

  sudo ln -s libreadline.so.8.0 libreadline.so.6

now Linux only uses the anaconda R as the system default.

when I type Which R the return is:

/home/x/anaconda3/bin/R

this is the R version 3.2.2. I need to use the r-base version 4.0.5 but Rstudio now runs 3.2.2 version of R and I couldn't knit the Rmarkdowm file to work. I tried

export PATH=/usr/local/bin:$PATH

to be able to set the R PATH the to r-base(4.0.5) that didn't work and when I type R in the terminal it still uses the anaconda path.

/home/x/anaconda3/lib/R/bin/exec/R: /home/x/anaconda3/lib/R/bin/exec/../../lib/../../libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libreadline.so.6)

how can I set the Ubuntu path correctly to r-base(4.0.5) and still be able to use Jupiter notebook and r in an environment? sorry in advance for this question but I spent hours trying to solve it and couldn't fix it.

homa taha
  • 121
  • Can you either uninstall R in Anaconda (since you don't seem to need it) or upgrade it to 4.x? I presume you're using R in Anaconda because of some additional modules. You probably cannot mix-and-match them (i.e., use a 3.2.2 module with R 4.0.5) anyway. – Ray Apr 09 '21 at 09:04
  • Also, you probably did not correctly change your PATH if it is still the R command in anaconda that is executed. I guess that path to anaconda is set through .bashrc – vanadium Apr 09 '21 at 09:11
  • @Ray I want to use jupyter notebook with R. that is why I can't uninstall it. they seem to not have upgraded it to R version 4 – homa taha Apr 09 '21 at 09:16
  • @ vanadium I think you are right and I have not set the path correctly. do you know where r-base is installed in ubuntu 20.04? in.bashrc it only shows the conda, path not the R. – homa taha Apr 09 '21 at 09:19
  • I presume your issue is that Jupyter is part of Anaconda? So, back to my original question -- how come you can't upgrade the R in Anaconda to 4.x instead? In order to use Anaconda, you probably did a "conda activate XXX". Either that, or you need to create a ~/.condarc file with the entry auto_activate_base: false so that it doesn't auto activate. To switch between them, you just don't activate anaconda. Then you will get the original R and can even do a which R to find out its path. – Ray Apr 09 '21 at 09:41
  • So, looking here, it seems the latest R in Anaconda in 3.6.x . Unless another channel has a 4.0.x version, you will run into problems sooner or later. Basically, use 4.x with Ubuntu or 3.6.x with Anaconda . If you mix them (i.e., Jupyter from Anaconda with R in Ubuntu), you'll run into problems and defeat the purpose of Anaconda, which is to create a self-contained environment for reproducibility... – Ray Apr 09 '21 at 09:44
  • I made an env to use R in anaconda (I use it by conda activate r-tutorial). The ubuntu path for R changed in ubuntu after I set this environment now even Rstduio runs on anaconda version of R. I guess the default R in my device is now anaconda . How can I change the Ubuntu path correctly to r-base? I only want to use anaconda in the enviroment. – homa taha Apr 09 '21 at 09:59

0 Answers0