Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when loading rpy2 with anaconda

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

like image 336
Michael Avatar asked Sep 16 '15 07:09

Michael


1 Answers

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?

like image 73
asmeurer Avatar answered Oct 21 '22 20:10

asmeurer