Forums

Install rpy2 on custom R location

I am trying to get rpy2 to install from source with the follow:

tar -xzf rpy2-2.9.1.tar.gz
cd rpy2-2.9.1
python3.6 setup.py build install

The problem is I don't have admin rights and the default version of R is too old (R version 3.0.2 (2013-09-25)) for what I need. I therefore have installed a local version of R by following the these steps:

  1. downloaded the tar.gz of the development version of R from : ftp://ftp.stat.math.ethz.ch/Software/R/
  2. uncompress it to /home/{username}/R
  3. changed into the uncompressed directory /home/{username}/R/R-devel
  4. run "./configure"
  5. run "make"

I can now start R by executing /home/{username}/R/R-devel/bin/R and my R library is located /home/{username}/R/R-devel/library.

I am not sure how to set these paths so that python will know where my R installation is when I run 'python3.6 setup.py build install' in the rpy2 package directory.

The rpy2 documentation says that you can pass the following parameter into build: --r-home, --r-home-lib, and --r-home-modules. I have yet been successful at doing this. As far as I can tell, these parameters are deprecated.

Any help getting this to work is appreicated. Thanks!

That sounds like a question for the rpy2 project. If they've deprecated some arguments to their builder, I would think that they would have replaced them with something else.

Thanks for the insight. Do you know if R will ever become supported here at pythonanywhere? (I know it's not called 'ranywhere')

We may, at some point, support R, but not promises - it's very unlikely that we'll want to spend the time necessary to support it well.

That makes sense. Thanks again!