OSX Lion 上的 rpy2 错误
我已经尝试从源(python setup.py install)和macports安装rpy2(成功终止),并且在尝试导入rpy2时,我收到此错误:
/Library/Python/2.7/site-packages/rpy2/rinterface/__init__.py in <module>()
76
77
---> 78 from rpy2.rinterface._rinterface import *
79
80
ImportError: dlopen(/Library/Python/2.7/site-packages/rpy2/rinterface/_rinterface.so, 2): Library not loaded: /Library/Frameworks/R.framework/Versions/2.13/Resources/lib/libR.dylib
Referenced from: /Library/Python/2.7/site-packages/rpy2/rinterface/_rinterface.so
Reason: image not found
我似乎无法弄清楚这一点,有什么想法吗?
谢谢!
I've tried the installation (which terminates successfully) of rpy2 both from source (python setup.py install) and macports, and upon trying to import rpy2, I'm getting this error:
/Library/Python/2.7/site-packages/rpy2/rinterface/__init__.py in <module>()
76
77
---> 78 from rpy2.rinterface._rinterface import *
79
80
ImportError: dlopen(/Library/Python/2.7/site-packages/rpy2/rinterface/_rinterface.so, 2): Library not loaded: /Library/Frameworks/R.framework/Versions/2.13/Resources/lib/libR.dylib
Referenced from: /Library/Python/2.7/site-packages/rpy2/rinterface/_rinterface.so
Reason: image not found
I can't seem to figure this out, any idea?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Python 绑定依赖于有效的 R 安装。根据显示的文件路径,您提供的回溯必须来自源安装,并且没有找到 R 框架或库,如果已安装,这些框架或库不会位于该位置 (
/Library/Frameworks
)由 MacPorts 提供。最好的选择是坚持使用完整的 MacPorts 解决方案。这就提出了您安装的 rpy2 绑定版本的问题。目前,MacPorts 显示了三个可用版本:py25-rpy2
、py26-rpy2
和py27-rpy2
。每一个都安装到相应的 MacPorts Python 版本中。因此,如果您安装了 py27-rpy2,则需要调用 MacPorts python2.7。从终端 shell 尝试:The Python bindings depend on a working R installation. Based on the file paths shown, the traceback you give must be from your source install and it is not finding the R framework or libraries, which would not be in that location (
/Library/Frameworks
) if installed by MacPorts. Your best bet is to stick with the complete MacPorts solution. That raises the question of which version of the rpy2 bindings you installed. At the moment, MacPorts shows three available versions:py25-rpy2
,py26-rpy2
, andpy27-rpy2
. Each one is installed into the corresponding MacPorts Python version. So if you installedpy27-rpy2
, you need to invoke the MacPortspython2.7
. From a terminal shell, try: