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\
rpy2 is almost certainly not working with Python 2.6. Older Python versions are even less likely to work. While Python 3.3 should be working, earlier version of Python 3 are not expected to (they might work, they might not - you are on your own). Rpy2 is not expected to work at all with an R version < 2.8.
Installing rpy2 First up, install some packages. You must have Python >=3.7 and R >= 4.0 installed to use rpy2 3.5. 2. Once R is installed, install the rpy2 package by running pip install rpy2 .
rpy2 will typically require an R version that is not much older than itself. This means that even if your system has R pre-installed, there is a chance that the version is too old to be compaible with rpy2. At the time of this writing, the latest rpy2 version is 2.8 and requires R 3.2 or higher.
Open a cmd window (as Administrator) in the . whl's download dir. Set R_USER env var to current username: set R_USER=%USERNAME% python -m pip install rpy2‑2.9.
There is no official support of windows.
There exists pre-compiled binaries (see: https://rpy2.github.io/doc/latest/html/overview.html#microsoft-s-windows-precompiled-binaries) but they are for an older release.
At the time of writing using the Linux subsystem available with Windows 10 might be the best options.
it works fine with conda on windows
conda install rpy2
Are your R binaries in your PATH variable?
Try this in your command prompt:
path = C:\path\to\R
pip install rpy2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With