I am trying to build and install rpy2 Python Module. But got an error (see below).
I have R installed in C:\\Program Files\\R\\R-2.15.0\\
and R.h
I tried all of these on my Windows 10 and got nowhere. When I did the pip
, it said it was installed into the Anaconda version that I have been using for months, but when I tried an import rpy
, it just gave an error.
Was going to give up, but then I slept on it a night and then I did the following from the command line:
git
)R_HOME
environment variable to C:\Program Files\R\R-3.2.3
rpy2-2.7.5-cp27-none-win_amd64.whl
from http://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2 as suggested above.Downloads
directorypip install rpy2-2.7.5-cp27-none-win_amd64.whl
Here is a screen capture of the final steps:
mwise@MWISE-OPTO ~/Downloads
$ pip install rpy2-2.7.5-cp27-none-win_amd64.whl
Processing c:\users\mwise\downloads\rpy2-2.7.5-cp27-none-win_amd64.whl
Requirement already satisfied (use --upgrade to upgrade): six in c:\users\mwise\appdata\local\continuum\anaconda2\lib\site-packages (from rpy2==2.7.5)
Requirement already satisfied (use --upgrade to upgrade): singledispatch in c:\users\mwise\appdata\local\continuum\anaconda2\lib\site-packages (from rpy2==2.7.5
)
Installing collected packages: rpy2
Successfully installed rpy2-2.7.5
mwise@MWISE-OPTO ~/Downloads
$ python
Python 2.7.11 |Anaconda 2.4.1 (64-bit)| (default, Dec 7 2015, 14:10:42) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import rpy2
>>> import rpy2.robjects as robjects
>>> pi = robjects.r['pi']
>>> pi[0]
3.141592653589793
>>>
Hoping this will help someone down the line...