【问题标题】:Rpy2 error: "No module named _rinterface"?Rpy2 错误:“没有名为 _rinterface 的模块”?
【发布时间】:2011-04-23 12:44:18
【问题描述】:

尝试加载 rpy2 时出现以下错误:

>>> from rpy2 import robjects
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\rpy2\robjects\__init__.py", line 14, in <m
odule>
    import rpy2.rinterface as rinterface
  File "C:\Python26\lib\site-packages\rpy2\rinterface\__init__.py", line 78, in
<module>
    from rpy2.rinterface._rinterface import *
ImportError: No module named _rinterface

我正在使用 R 2.11.1、Python 2.6.5 和 rpy2 2.2.2.0。

有什么想法吗?

【问题讨论】:

  • 我不确定目前 MSWindows 是否支持 rpy2(从 2.0.8 版开始)。如果某个地方有构建,我相信会有兴趣看到它做出贡献。
  • 真的吗?太糟糕了。谢谢@lgautier!
  • 你考虑过 PypeR 吗?我还没试过。我相信this is its homepagethis is an article about it,将其与 Rpy 和 Rpy2 进行比较。

标签: python r rpy2


【解决方案1】:

我认为问题在于 rinterface 无法在您的盒子上找到 R。在 unix 中,您可以通过更新 bashrc 配置文件(通常位于 /etc/bashrc)来解决此问题。在那里,您将添加这样的一行:LD_LIBRARY_PATH=/path/to/R

windows里面肯定有类似的东西……

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-12
    • 2017-12-26
    • 2019-01-17
    • 2014-12-25
    • 2018-04-29
    • 2011-06-26
    • 2017-01-07
    • 2013-06-28
    相关资源
    最近更新 更多