0

I recently installed rpy2 via pip: $ pip install rpy2, to use R from inside python. This worked and I can use it in python, however it seems to have overwritten all my R environment variables, and now I can't use RStudio anymore. It just leaves my with a chrome startscreen, telling me:

This site can’t be reached 127.0.0.1 refused to connect. Try:

Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED

When I start RStudio via terminal I get "Uncaught TypeError: Cannot read property 'notifyRCrashed' of undefined"

When I run rstudio --run-diagnostics it returns

Using R script: /home/nhoeche/anaconda3/bin/R

Attempting to launch R session...
  R_HOME=/home/nhoeche/anaconda3/lib/R
  R_DOC_DIR=/home/nhoeche/anaconda3/lib/R/doc
  R_INCLUDE_DIR=/home/nhoeche/anaconda3/lib/R/include
  R_SHARE_DIR=/home/nhoeche/anaconda3/lib/R/share
  LD_LIBRARY_PATH=/home/nhoeche/anaconda3/lib/R/lib:
  PATH=/home/nhoeche/anaconda3/bin:/home/nhoeche/anaconda3/condabin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/nhoeche/.local/bin:/home/nhoeche/bin
  HOME=/home/nhoeche

R session launched, attempting to connect on port 9681...
/usr/lib/rstudio/bin/rsession: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/nhoeche/anaconda3/lib/R/lib/../../libicuuc.so.58)
/usr/lib/rstudio/bin/rsession: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/nhoeche/anaconda3/lib/R/lib/../../libicuuc.so.58)
/usr/lib/rstudio/bin/rsession: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/nhoeche/anaconda3/lib/R/lib/../../libicui18n.so.58)
/usr/lib/rstudio/bin/rsession: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/nhoeche/anaconda3/lib/R/lib/../../libicui18n.so.58)

Connected to R session, attempting to initialize...

The path /home/nhoeche/anaconda3/bin/R definitely refers to my python R installation, not my "normal" one. How can I retrieve where my normal installation is and reset all the paths?

I already tried reinstalling R and RStudio, and I tried deleting / moving .rstudio-desktop, RData and so on....

My operating system is CentOS 7.

1 Answer 1

0

So the problem originated from the anaconda path preceeding my "normal" path. $ echo $PATH gave me

/home/nhoeche/anaconda3/bin:/home/nhoeche/anaconda3/condabin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/nhoeche/.local/bin:/home/nhoeche/bin

rpy2 installed r-base in anaconda which is why my system took the python-R installation as default. This is why removing rpy2 or rstudio or R did nothing, becauser-base` was still there in anaconda.

I uninstalled rpy2 as well as r-base in anaconda to resolve this. I also specified export RSTUDIO_WHICH_R=/usr/bin/R in .profile just to be sure. It works fine again now.

I read that if you install rpy2 via pip rather than via conda, it is possible to have it point to your "default" r installation, rather than installing it again inside anaconda.

1
  • i don't have rpy2 and r-base in my conda-list. Still facing the issue. echo $PATH gaves me following OP /home/susaj/anaconda3/condabin:/home/susaj/bin:/home/susaj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    – Susaj S N
    Apr 5, 2020 at 5:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .