3

I am using Linux, Debian based, and trying to install rpy2 with pip3.

When type:

sudo pip3 install rpy2

I get

user@huayra:~$ sudo pip3 install rpy2
Collecting rpy2
  Using cached rpy2-2.9.2.tar.gz
    Complete output from command python setup.py egg_info:
    Error: Tried to guess R's HOME but no command 'R' in the PATH.
  ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-r6axcg8n/rpy2/

I have pip3 installed, the version is:

pip 9.0.1 from /usr/local/lib/python3.4/dist-packages (python 3.4)

EDIT

After some updates I re-run the command sudo pip3 install rpy2 and get:

    Error: R >= 3.3 required (and the R we found is '3.1.1').
    R version 3.1.1 (2014-07-10) -- "Sock it to Me"     
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3n_yfk5i/rpy2/

Any help please?

  • 1
    The error message is trying to help you: rpy2 requires R version 3.3 or greater and you appear to have R 3.1.1 installed. – lgautier Jan 20 '18 at 17:24
  • @lgautier yes I know but that is the updated version of R. Any idea how to get a higher version? –  Jan 20 '18 at 18:12
  • 1
    Did you check https://cran.r-project.org/bin/linux/debian/ ? – lgautier Jan 20 '18 at 18:36
  • I am reading it but can't understand it at all. Possibly I don't have an appropiate direction in /etc/apt/sources.list but don't know how to modify it @lgautier –  Jan 20 '18 at 19:29
  • @lgautier here a new question about this issue: https://stackoverflow.com/questions/48360327/how-to-install-newer-r-packages –  Jan 20 '18 at 19:39

1 Answers1

3

That package has been part of the distribution for many years -- I'm the maintainer.

So just do

  • sudo apt-get install python-rpy2 (Python 2 on e.g. Debian stable)
  • sudo apt-get install python3-rpy2 (Python 3, available everywhere)

and it will bring all required dependencies in as usual.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725