HOME Error with rpy2
I know there are quite a few posts on getting up and running with rpy2 on windows 7 32 bit. I have referenced a good number of them and attempted their solutions, including the use of PypeR
.
I dont explicitly have a R_HOME variable set in my path, but per this question, I confirmed that R is in my PATH (I can type R
at the command line and get R to run) and even copied all of the files from the i386 folder to the parent bin
folder.
My issue is pasted below. Any thoughts?
In [5]: from rpy2 import robjects
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-5-1f019d00d232> in <module>()
----> 1 from rpy2 import robjects
C:Anacondalibsite-packagesrpy2robjects__init__.py in <module>()
16 import rpy2.rlike.container as rlc
17
---> 18 from rpy2.robjects.robject import RObjectMixin, RObject
19 from rpy2.robjects.vectors import *
20 from rpy2.robjects.functions import Function, SignatureTranslatedFunction
C:Anacondalibsite-packagesrpy2robjectsrobject.py in <module>()
3 import rpy2.rinterface
4
----> 5 rpy2.rinterface.initr()
6
7 import conversion
RuntimeError: R_HOME not defined.
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.
链接地址: http://www.djcxy.com/p/72622.html下一篇: HOME rpy2错误