rpy2 error after upgrading to OSX El Capitan
Asked Answered
S

1

6

I have an error occurring in a very similar way to this SO question. The solution of simply installing rpy2 using conda doesn't work.

The key difference in my case is that rpy2 worked properly before I updated to Mac OSX 10.11 (El Capitan). My Python version is Python 2.7.10, conda: 3.18.4, R: R version 3.2.2 (2015-08-14) -- "Fire Safety and all were installed using the anaconda distribution.

I get the following error:

ImportError: dlopen(/Users/user/anaconda/lib/python2.7/site-packages/rpy2/rinterface/_rinterface.so, 2): Library not loaded: @rpath/R/lib/libR.dylib
Referenced from: /Users/user/anaconda/lib/python2.7/site-packages/rpy2/rinterface/_rinterface.so
Reason: image not found

when trying to load the rpy2.ipython extension:

%load_ext rpy2.ipython 

I have a hunch it is a fix similar to this question dealing with loading the rJava R package.

Spiffing answered 12/11, 2015 at 13:29 Comment(4)
so I assume you already tried reinstalling?Nestle
I reinstalled R a couple times, but not anaconda -- I'll do that!Spiffing
That worked. I feel dumb now.Spiffing
I actually assumed you would only reinstall condas version of rpy2 and r, but this also works :)Nestle
S
3

Uninstalling anaconda and reinstalling everything from scratch fixed the error.

Spiffing answered 13/11, 2015 at 10:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.