Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rpy2 not working after upgrading R to 3.0.1

Tags:

python

r

rpy2

I have had a python script that uses rpy2 internally. This script was working until very recently. However, it stopped working now. I got an error that I had not seen previously. I can reproduce the error with the following lines of code:

$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpy2.robjects as robjects
cannot find system Renviron
Error in getLoadedDLLs() : there is no .Internal function 'getLoadedDLLs'
Error in checkConflicts(value) : 
".isMethodsDispatchOn" is not a BUILTIN function
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/rpy2-2.2.5dev_20120328-py2.6-macosx-10.6-    universal.egg/rpy2/robjects/__init__.py", line 17, in <module>
from rpy2.robjects.robject import RObjectMixin, RObject
File "/Library/Python/2.6/site-packages/rpy2-2.2.5dev_20120328-py2.6-macosx-10.6-universal.egg/rpy2/robjects/robject.py", line 9, in <module>
class RObjectMixin(object):
File "/Library/Python/2.6/site-packages/rpy2-2.2.5dev_20120328-py2.6-macosx-10.6-universal.egg/rpy2/robjects/robject.py", line 22, in RObjectMixin
__show = rpy2.rinterface.baseenv.get("show")
LookupError: 'show' not found

I do not why this should not work. Is there any way to fix this.

like image 723
Sam Avatar asked Oct 25 '25 19:10

Sam


1 Answers

This page describes a potential solution for this problem (at least, the problem described by the author looks very similar): apparently, rpy2 has to be recompiled and given the new version of R as an argument.

like image 190
Bertrand Moreau Avatar answered Oct 27 '25 08:10

Bertrand Moreau