R_HOME Error with rpy2 R_HOME Error with rpy2 r r

R_HOME Error with rpy2


I confirm this issue is related to R_HOME variable not defined.

In my opinion, all of these issues are caused because the developers of rpy2 package haven't documented properly the requirements of their software:

  • Install R
  • Create R_HOME system variable
  • Add R_HOME\bin to the PATH, in order to execute R from python
  • Add R_HOME\bin\x64 to the PATH, in order to load R.dll
  • Install package tzlocal


With help from the comment above, I got moving in the proper direction. I created the R_HOME as a SYSTEM variable. That didn't work right away, as I was getting an R_USER not defined error.

To get everything the import above to work without error, I simply re-installed the rpy2 exectuable from here after defining the R_HOME. No errors.

In summary, key was o have R_HOME set PRIOR TO installing rpy2.