Question

I am trying to install rpy2. I have installed R, and rpy2. I try to import rpy2.robjects as robjects.

I get the following error:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    import rpy2.robjects as robjects
  File "C:\Python27\lib\site-packages\rpy2\robjects\__init__.py", line 15, in <module>
    import rpy2.rinterface as rinterface
  File "C:\Python27\lib\site-packages\rpy2\rinterface\__init__.py", line 90, in <module>
    raise RuntimeError("Unable to locate R.dll within %s" % R_HOME)
RuntimeError: Unable to locate R.dll within C:\Program Files\R\R-3.0.2\bin\x64\

I have created R_HOME as C:\Program Files\R\R-3.0.2\bin\64 in my environment variables . There is a R.dll in this location what am I doing wrong why wont this work?

No correct solution

OTHER TIPS

Are you Gohlke's binaries?

Among various combinations, R_HOME of c:\Progra~1\R\R-3.0.3\

and

c:/program files/r/r-3.0.3

worked for me. Looks like either it doesn't like the or the \ or both.

The error is probably caused by the R_HOME variable pointing to x64. Use as mentioned c:\Progra~1\R\R-3.0.3\ in the R_HOME variable. See rpy2 install on windows 7

HTH

I had the same problem. Turns out this is NOT the correct path to put in R_HOME:

C:\Program Files\R\R-3.0.2\bin\64

instead use:

C:\Program Files\R\R-3.0.2\

Substituting whichever version number you have installed for R-3.0.2.

I looked in the rpy2 source and saw it searched R_HOME with bin appended and lib appended, so you don't need it in R_HOME.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top