Install rpy2 - USEPA/useeiopy GitHub Wiki

Python package for running the R interpreter from within python

To install rpy2 on Windows, one can follow these steps

  1. Go to Unofficial Windows Binaries for Python Extension Packages
  2. Download an appropriate whl file, paying attention to python version (3.4 through 3.7) and bit (32 or 64). Tested with Python 3.7.6 x64 RPy2 Download Options
  3. Open a command prompt and navigate to the whl file location (downloads).
  4. Switch to the python virtual environment if using one [ workon venv_name ]
  5. Install the whl [ pip install rpy2-2.9.5-etc.whl ]
  6. You must set environmental variables for R_USER and R_HOME in the computer registry. See this StackOverflow discussion for help. How to setup environment variable R_user to use rpy2 in python