jupyter-lab中出现rpy2错误-未找到合适的图像

时间:2019-09-19 01:01:59

标签: r python-3.x jupyter-notebook rpy2 jupyter-lab

导入rpy2可以在终端中运行python时找到,但是在jupyter-lab笔记本中运行时会抛出错误

Python 3.7.4(默认,2019年8月13日,15:17:50) R:lrwxr-xr-x 1 root admin 30 Jul 30 09:58当前-> 3.6

将R_home设置为:

import os
os.environ['R_HOME'] = '~/anaconda3/envs/R/bin/R'

还在/Library/Frameworks/R.framework

尝试了另一个本地安装的R

运行: 导入rpy2.rinterface

它通过运行python内核在mac终端中成功运行。 但是,当它通过anaconda3在jupyterlab中运行时,会抛出:

导入操作系统 os.environ ['R_HOME'] ='〜/ anaconda3 / envs / R / bin / R' 导入rpy2.rinterface

OSError: cannot load library '~/anaconda3/envs/R/bin/R/lib/libR.dylib': dlopen(~/anaconda3/envs/R/bin/R/lib/libR.dylib, 2): no suitable image found.  Did find:
    ~/anaconda3/envs/R/bin/R/lib/libR.dylib: stat() failed with errno=20

0 个答案:

没有答案