%load_ext rpy2.ipython Image not found error

我的梦境 提交于 2019-12-10 10:04:44

问题


I am trying to use the magic command in ipython, something I saw here: rpy2 slides

I have done the following:

import rpy2.ipython
%load_ext rpy2.ipython

But I get the following error:

ImportError: dlopen(/Users/XXX/anaconda/lib/python2.7/site-packages/rpy2/rinterface/_rinterface.so,

2): Library not loaded: libicuuc.54.dylib Referenced from: /Users/XXX/anaconda/lib/python2.7/site-packages/rpy2/rinterface/_rinterface.so Reason: image not found

Some relevant information:

  • OS: MacOS Sierra
  • Python: 2.7.12
  • iPython: IPython 5.1.0
  • rpy2: 2.8.3
  • Did the pip install singledispatch but the error still persists
  • r installed using conda
  • Also have a copy of R from CRAN

回答1:


Because I installed R through conda, I also needed to install rpy2 through conda and not through pip. To install rpy2 through conda do the following,

conda install -c r rpy2

This worked really well. However, it is unclear why installing rpy2 through pip does not work.



来源:https://stackoverflow.com/questions/39756013/load-ext-rpy2-ipython-image-not-found-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!