[R-sig-Geo] problem loading sp using Rpy (python)

Jorge de Jesus jorge.de-jesus at jrc.it
Mon Oct 8 09:50:28 CEST 2007


Hi to all
I am working on Python and Rpy to make automatic interpolations. I need
to use the sp library of R.

When Rpy calls my R scripts it creates an error saying that the sp
package can't be loaded. But inside the R environment everything works ok.

When I removed sp and then reinstalled I got the following error:

trying URL
'http://rm.mirror.garr.it/mirrors/CRAN/src/contrib/sp_0.9-14.tar.gz'
Content type 'application/x-gzip' length 359180 bytes
opened URL
==================================================
downloaded 350Kb

* Installing *source* package 'sp' ...
** libs
Error in library.dynam(lib, package, package.lib) :
shared library 'sp' not found
In addition: Warning messages:
1: package 'sp' contains no R code in: loadNamespace(package,
c(which.lib.loc, lib.loc), keep.source = keep.source)
2: S3 methods ‘as.data.frame.SpatialPoints’,
‘as.data.frame.SpatialPixels’, ‘as.data.frame.SpatialGrid’,
‘as.data.frame.SpatialPointsDataFrame’,
‘as.data.frame.SpatialPixelsDataFrame’,
‘as.data.frame.SpatialGridDataFrame’,
‘as.data.frame.SpatialLinesDataFrame’,
‘as.data.frame.SpatialPolygonsDataFrame’, ‘as.data.frame.GridTopology’,
‘as.matrix.SpatialGridDataFrame’, ‘as.matrix.SpatialPixelsDataFrame’,
‘cbind.SpatialGridDataFrame’, ‘contour.SpatialPixelsDataFrame’,
‘contour.SpatialGridDataFrame’, ‘dim.SpatialPointsDataFrame’,
‘image.SpatialPixelsDataFrame’, ‘image.SpatialGridDataFrame’,
‘lines.Line’, ‘lines.Lines’, ‘lines.SpatialLines’,
‘lines.SpatialLinesDataFrame’, ‘names.SpatialPointsDataFrame’,
‘names.SpatialPixelsDataFrame’, ‘names.SpatialGridDataFrame’,
‘names.SpatialLinesDataFrame’, ‘names.SpatialPolygonsDataFrame’,
‘names<-.SpatialPointsDataFrame’, ‘names<-.SpatialPolygonsDa [... truncated]
During startup - Warning message:
package sp in options("defaultPackages") was not found
gcc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -fpic -g -O2 -c gcdist.c -o gcdist.o
gcc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -fpic -g -O2 -c init.c -o init.o
gcc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -fpic -g -O2 -c pip.c -o pip.o
gcc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -fpic -g -O2 -c Rcentroid.c -o Rcentroid.o
gcc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/local/include -fpic -g -O2 -c zerodist.c -o zerodist.o
gcc -std=gnu99 -shared -L/usr/local/lib -o sp.so gcdist.o init.o pip.o
Rcentroid.o zerodist.o -L/usr/local/lib/R/lib -lR
** R
** data
** demo
** inst
** preparing package for lazy loading
Error in code2LazyLoadDB(package, lib.loc = lib.loc, keep.source =
keep.source, :
name space must not be loaded.
Execution halted
ERROR: lazy loading failed for package 'sp'
** Removing '/usr/local/lib/R/library/sp'

The downloaded packages are in
/tmp/RtmpttNUa3/downloaded_packages
Warning message:
installation of package 'sp' had non-zero exit status in: install.packages()


Also I managed to get some extra info from Rpy, where it says the sp
library isn't loaded because of R_alloc() and some namespace problem(?).

Can anyone give me some help on understanding what is the problem and
how to fix it ??

Thanks
Jorge


-- 
Eng. Jorge Samuel Mendes de Jesus

European Commission (EC)
Joint Research Centre Directorate (DG JRC)
Institute for Environment and Sustainability (IES)
TP 441, Via Fermi 1
21020 Ispra (VA)
Italy

Phone: +39 0332 78 3536
Fax:   +39 0332 78 5466

http://rem.jrc.cec.eu.int

"The views expressed are purely those of the writer and may not in any circumstances be regarded as stating an official position of the European Commission"




More information about the R-sig-Geo mailing list