On Mon, 2008-10-20 at 12:39 -0700, Eric Bell wrote:
> No change in behavior. I've simplifed my python script and added the
> import rpy2.rinterface as instructed. I've stopped and started the
> apache server as appropriate voodoo.

No change was expected: '--verbose' instructs R to tell a bit more of
what it is doing. Looking whether a hint appear when inspecting what it
tells is the way to go (although I am not sure that a hint appears, as
mentioned in a previous email).

> Seems to me if I can't execute the library() call then it makes sense
> that R functionality in the non-base libraries won't be available.
> 
> Other info: I'm running on Unbuntu Gusty ... I couldn't find a
> packaged shared libraries version of R so I built it myself. I did
> have R installed previously using the Synaptic package manager and
> subsequently deinstalled when I built the shared library version. I've
> just confirmed that Synatpic indicates that R is not installed. I
> notice that if I do a printenv in a shell, there's no R_HOME variable
> defined. Should there be? I recall having to futz with this when I was
> trying to install the RSPython extension...the builds kept failing
> because R_HOME was point to the wrong place.
> 
> I'm happy to run other tests if you tell me what to do.

Running the unit tests (see the documentation for rpy2) in order to
ensure that installation is otherwise proper is something recommended,
if not already done.


> --eric
> 
> 
> PYTHON SCRIPT
> 
>         from mod_python import apache
>         
>         import rpy2.rinterface as ri
>         
>         # this must go before the import rpy2 
>         ri.set_initoptions(('rpy2','--verbose','--vanilla','--nosave'))
>         
>         import rpy2
>         from rpy2 import robjects
>         
>         def handler(req):
>                 r = robjects.r
>         
>                 r("library()")
>         
>                 req.content_type = 'html'
>                 req.write("<HTML><BODY>Hello beautiful
>         World!<BR></BODY></HTML>") 
>                 return apache.OK
>         
> Traceback: 
> 
>   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, 
> in HandlerDispatch
>     default=default_handler, arg=req, silent=hlist.silent)
> 
>   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, 
> in _process_target
>     result = _execute_target(config, req, object, arg)
> 
>   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, 
> in _execute_target
>     result = object(arg)
> 
>   File "/var/www/apache2-default/test_python/test1.py", line 14, in handler
>     r("library()")
> 
>   File "/usr/lib/python2.5/site-packages/rpy2/robjects/__init__.py", line 
> 501, in __call__
>     res = self.eval(p)
> 
>   File "/usr/lib/python2.5/site-packages/rpy2/robjects/__init__.py", line 
> 381, in __call__
>     res = super(RFunction, self).__call__(*new_args, **new_kwargs)
> 
>         RRuntimeError: Error in gzfile(file, "rb") : invalid 'encoding' 
> argument


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to