R_HOME Error with rpy2(R_HOME rpy2 错误)
问题描述
我知道有很多关于在 Windows 7 32 位上使用 rpy2 启动和运行的帖子.我参考了其中的很多并尝试了他们的解决方案,包括使用 PypeR
.
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
.
我没有在我的路径中明确设置 R_HOME 变量,但是根据这个 问题,我确认 R 在我的 PATH 中(我可以在命令行输入 R
并让 R 运行),甚至复制了所有文件从 i386 文件夹到父 bin
文件夹.
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-packages
py2
objects\__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-packages
py2
objects
object.py in <module>()
3 import rpy2.rinterface
4
----> 5 rpy2.rinterface.initr()
6
7 import conversion
RuntimeError: R_HOME not defined.
推荐答案
我确认此问题与未定义的 R_HOME
变量有关.
I confirm this issue is related to R_HOME
variable not defined.
在我看来,所有这些问题都是由于 rpy2
包的开发人员没有正确记录他们的软件需求造成的:
In my opinion, all of these issues are caused because the developers of rpy2
package haven't documented properly the requirements of their software:
- 安装
R
- 创建
R_HOME
系统变量 - 将
R_HOMEin
添加到PATH
,以便从python
执行 - 将
R_HOMEinx64
添加到PATH
,以便加载R.dll
- 安装包
tzlocal
R
- Install
R
- Create
R_HOME
system variable - Add
R_HOMEin
to thePATH
, in order to executeR
frompython
- Add
R_HOMEinx64
to thePATH
, in order to loadR.dll
- Install package
tzlocal
这篇关于R_HOME rpy2 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:R_HOME rpy2 错误
基础教程推荐
- 用于分类数据的跳跃记号标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 筛选NumPy数组 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01