13

I am trying to load rpy2 inside a project where I am working with anaconda and I am getting a surprising error for which I cannot find a solution. My python version is 3.4, my anaconda version is 3.17.0 - I am using a Mac (OSX Yosemite version 10.10.4)

R version 3.2.2 (2015-08-14) -- "Fire Safety"

Platform: x86_64-apple-darwin11.4.2 (64-bit)

try:
    from rpy2 import robjects
except ImportError as e:
    print(e)

I am getting this error message

dlopen(/Users/user1/anaconda/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so, 2): Library not loaded: @rpath/R/lib/libR.dylib Referenced from:

/Users/user1/anaconda/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so Reason: image not found

Thanks in advance for your help

1 Answer 1

16

I just built an updated rpy2 2.7.0 against R 3.2.2. Can you run

conda install -c r rpy2 

and see if that fixes it?

4
  • @asmeurer -- I have the exact same issue and installing rpy2 as you outlined doesn't fix it. I just upgraded to Mac OSX 10.11, my Python version is 'Python 2.7.10', conda: '3.18.4', R: 'R version 3.2.2 (2015-08-14) -- "Fire Safety"' -- I have updated all conda packages, installed r-essentials, and everything else I can imagine
    – Clayton
    Commented Nov 12, 2015 at 7:35
  • I created a new question as I think this might be a more complex issue: stackoverflow.com/questions/33672565/…
    – Clayton
    Commented Nov 12, 2015 at 13:30
  • 1
    installing with conda i got gist.github.com/88bf9ed4f9234a2c88ea that seems related to rpy2 version (bug fixed in 2.7.4, conda seems to install 2.7.0): bitbucket.org/rpy2/rpy2/issues/313/…
    – epifanio
    Commented Jan 19, 2016 at 19:15
  • Do you have any suggestions for using rpy2 with an r-conda environment? stackoverflow.com/questions/42126077/…
    – O.rka
    Commented Feb 9, 2017 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.