Install rpy2 using pip install xx.whl on windows 10

Viewed 1835

I want to use rpy2 library on my labtop. But I have failed to installed this whole morning.

A few question have posted here. Any advice would be appreciate!

Attempt 1

Using pip install rpy2. The result shows like:

 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 c:\users\hyf\appdata\local\temp\pip-build-gkdpb0\rpy2\  

Attempt 2

Then, I read some post. And someone told that with .whl format package can solve the problem. SO: Using pip install rpy2-2.7.8-cp27-none-win_amd64.whl to install the package which I downloaded. Failed with:

IOError: [Errno 13] Permission denied: 'D:\\Program\\Anaconda\\Lib\\site-packages\\rpy2\\rinterface\\_rinterface.pyd'

Attempt 3

Usingconda install --channel https://conda.binstar.org/joshadel rpy2, the rpy2 package can be installed.

But when I call it in ipython notebook like this:

import rpy2
from rpy2.robjects import r

The result shows the error:

RuntimeError: R_HOME not defined.

But I have added the environment variables into system variables like this:

R_HOME:D:\Program\R\bin\x64
R_User:D:\Program\Anaconda\Lib\site-packages\rpy2   

I'm using Anaconda with Python2.7 kernel and R 3.2.2.

1 Answers
Related