-->

Install rpy2 returns an error

2019-02-19 19:51发布

问题:

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:

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.



标签: python rpy2