On May 4, 8:29 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Sun, May 4, 2008 at 2:35 PM, Art <[EMAIL PROTECTED]> wrote:
>
> > I am unsuccessful at using rpy through the sage notebook. A Traceback
> > is appended. I am assuming this is the sage interface to R (through
> > 'from rpy import r'). I have spent the last few hours learning the
> > rudiments of sage, python, R, and rpy, in that order. I am using the
> > Ubuntu Hardy with the Linux binary distribution:
>
> > sage-3.0-ubuntu64-opteron-x86_64-Linux.tar.gz
>
> > I have separately installed R-2.6.2 and the latest debian package for
> > rpy (as there is an Ubuntu bug that generates the same Traceback on
> > importing rpy). I am wondering how to fix this problem as it looks
> > like my installation of sage uses it's own local version of
> > everything, but I'm not sure. I've tried different set_options()
> > unsuccessfully.
>
> > Before hacking into the sage distribution and given I have no idea
> > what I'm doing, I was wondering if this is indeed the interface to R
> > and if there is a quick fix for this problem. I have read through some
> > of the trac tickets and postings on your forums but I don't know
> > enough at this point to solve this myself.
>
> Just "for fun" could you also try using the default
> (non rpy) r object in a fresh Sage session:
>
> sage: r('2+3')
> [1] 5
> sage: r([1..100]).mean()
> [1] 50.5
>
> See the examples here:
> http://wiki.sagemath.org/R
>
> -- William
>
>
>
>
>
> > from rpy import r
>
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > File "/home/art/.sage/sage_notebook/worksheets/admin/7/code/2.py",
> > line 6, in <module>
> > from rpy import r
> > File "/home/art/sage/local/lib/python2.5/site-packages/sympy/
> > plotting/", line 1, in <module>
>
> > File "/home/art/sage/local/lib/python2.5/site-packages/rpy.py", line
> > 134, in <module>
> > """ % RVERSION)
> > RuntimeError: No module named _rpy2062
>
> > RPy module can not be imported. Please check if your rpy
> > installation supports R 2.6.2. If you have multiple R versions
> > installed, you may need to set RHOME before importing rpy. For
> > example:
>
> > >>> from rpy_options import set_options
> > >>> set_options(RHOME='c:/progra~1/r/rw2011/')
> > >>> from rpy import *
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washington
> http://wstein.org
Thanks for the pointer to the default R interface. I had read about it
somewhere in your docs but couldn't find it again.
Not sure how I missed #3011. I solved the original problem by
installing debian package python-rpy (1.0.1-4) and copied _rpy2062.so
to sage/local/lib/python2.5/site-packages and it works.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---