Rpy2 错误:“没有名为 _rinterface 的模块”?
尝试加载 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。
有什么想法吗?
I am getting the following error when trying to load 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
I'm using R 2.11.1, Python 2.6.5, and rpy2 2.2.2.0.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题在于 rinterface 在您的盒子上定位 R 时遇到问题。在 unix 中,您可以通过更新 bashrc 配置文件(通常位于 /etc/bashrc)来解决此问题。在那里,您需要添加如下行: LD_LIBRARY_PATH=/path/to/R
Windows 中必须有类似的内容...
I believe the issue is that rinterface is having trouble locating R on your box. In unix, you can solve this by updating the bashrc profile (typically located at /etc/bashrc). There, you'd add a line like this: LD_LIBRARY_PATH=/path/to/R
There must be something similar in windows...