问题
I am trying to install the rpy2
package for python 3 on Windows 7. So I simply typed pip install rpy2 in the command line. However, it fails for a reason I do not understand, could anyone clear this up please? It threw back the following in the command line:
Collecting rpy2
Using cached rpy2-2.8.2.tar.gz
Complete output from command python setup.py egg_info:
Warning: 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\...\AppData\Local\Temp\pip-build-14jn4kdx\rpy2\
回答1:
There is no official support of windows. The easiest is to install a precompiled binary package, or so I hear. See: http://rpy2.readthedocs.io/en/default/overview.html#microsoft-s-windows-precompiled-binaries
回答2:
Are your R binaries in your PATH variable?
Try this in your command prompt:
path = C:\path\to\R
pip install rpy2
回答3:
it works fine with conda on windows
conda install rpy2
来源:https://stackoverflow.com/questions/38955491/installing-rpy2-for-python-3-using-pip