Cannot load packages

40 views
Skip to first unread message

Henry Paik

unread,
Sep 24, 2009, 3:02:52 PM9/24/09
to rapache
Hi RApache group,

I have been restarting apache many many times today for RApache
testing. :)

It was working well until I tried to load some packages.

First, I tried

REvalOnStartup "library(RSVGTipsDevice); library(DBI); library
(RMySQL); "

in /etc/apache2/httpd.conf

When I restarted apache, I got errors in apache error log.

[Thu Sep 24 14:52:09 2009] [notice] Apache/2.2.11 (Ubuntu) PHP/
5.2.6-3ubuntu4.2 with Suhosin-Patch mod_R/1.1.8 R/2.9.2 mod_perl/2.0.4
Perl/v5.10.0 configured -- resuming normal operations
Error in library(RSVGTipsDevice) :
there is no package called 'RSVGTipsDevice'
Error in library(RSVGTipsDevice) :
there is no package called 'RSVGTipsDevice'
Error in library(RSVGTipsDevice) :
there is no package called 'RSVGTipsDevice'
Error in library(RSVGTipsDevice) :
there is no package called 'RSVGTipsDevice'
Error in library(RSVGTipsDevice) :
there is no package called 'RSVGTipsDevice'
....

I had to stop the server.

Then I commented out that line in httpd.conf

This time, I tried to load packages from R script. The result is same.
It complains as below when I hit the R script.

[Thu Sep 24 14:55:29 2009] [error] [client 192.168.4.0] Error in
library("RSVGTipsDevice") : \n there is no package called
'RSVGTipsDevice'\n
[Thu Sep 24 14:55:29 2009] [error] [client 192.168.4.0] Error
evaluating /var/www/rapache/sendSVG.r!\n

I do not have any problems to load those packages from R. Please see
below.

hpaik@ubuntu:/var/www/rapache$ R

R version 2.9.2 (2009-08-24)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RSVGTipsDevice)
> library(DBI)
> library(RMySQL)
>

Please help.

Thank you very much!

- Henry

Brad Friedman

unread,
Sep 25, 2009, 12:04:01 AM9/25/09
to rapache

This has only a small chance of helping you, but I once had a similar
case, and it turned out that I had 2 R installations on the machine. I
could load my library from the command-line R because it was properly
installed for that R, but the R that RApache used was a different one
and so couldn't see the library.

Henry Paik

unread,
Sep 25, 2009, 8:25:44 AM9/25/09
to rapache
Hey Brad,

Thanks for your email.

How did you know that you had 2 R installations?
I would like to check if this is the same case with yours.

I thought I might have installed those packages locally (i.e. under my
account). So I tried sudo R and loaded packages. They loaded fine.

What other things may I test/check?

Thanks for your help and time again!

- Henry

On Sep 25, 12:04 am, Brad Friedman <brad.aaron.fried...@gmail.com>
wrote:

Jeffrey Horner

unread,
Sep 25, 2009, 10:14:10 AM9/25/09
to rap...@googlegroups.com
Henry Paik wrote on 09/25/2009 07:25 AM:
> Hey Brad,
>
> Thanks for your email.
>
> How did you know that you had 2 R installations?
> I would like to check if this is the same case with yours.
>
> I thought I might have installed those packages locally (i.e. under my
> account). So I tried sudo R and loaded packages. They loaded fine.
>
> What other things may I test/check?

Print out your .libPaths() from one of your rapache scripts. Then do the
same from the command line and see if there's a difference. You might be
getting tripped up by your ~/.Rprofile.

Also, don't forget the "r-info" handler can show you much more about
your installation. Put this in your apache config:

<Location /RApacheInfo>
SetHandler r-info
</Location>

Best,

Jeff
--
http://biostat.mc.vanderbilt.edu/JeffreyHorner

Henry Paik

unread,
Sep 25, 2009, 11:45:15 AM9/25/09
to rap...@googlegroups.com
Hey Jeff, Brad and all,

Jeff, you are right! When I listed /usr/local/lib/R/site-library, I was surprised nothing is there.

Somehow all the packages were installed under my account. and sudo R somehow knew the right path to those packages but not rapache.

I installed those packages under /usr/local/lib/R/site-library. Now it seems OK.

Thanks again for your help!

- Henry
Reply all
Reply to author
Forward
0 new messages