[R] RSPython can't find module

Simon Frost sdf22 at cam.ac.uk
Tue Sep 8 17:42:44 CEST 2009


Hi Folks,

After seeing some tips on the web, I managed to get RSPython-0.7-1 
installed with R 2.9.0 (on Ubuntu 8.04). I had to get rid of the extra 
comma in the PythonPath function in Python.S:

.PythonPath <-
function(path=NULL, merge = TRUE)
{
 dirSep <- ifelse(R.version$os == "Win32", ";", ":",)

(remove last comma before bracket)

and I had to manually copy RSPython.so to RSInternal.so in the libs 
subdirectory of my RSPython installation. Now RSPython seems to load up 
OK, with a couple of warnings:

 > require(RSPython)
Loading required package: RSPython
Initialized R-Python interface package.
Warning messages:
1: In .PythonInit() :
  the Python callback manager has been registered implicitly using the 
defaults (referenceManager())!
2: In getPythonHandler() :
  the Python callback manager has been registered implicitly using the 
defaults (referenceManager())!

and it works fine for built-in functions:

 > .Python("range",0,10)
sys:1: DeprecationWarning: integer argument expected, got float
 [1] 0 1 2 3 4 5 6 7 8 9

However, I can't load up any of my own libraries, even though they're in 
the PYTHONPATH, and I can load them up in Python without problems.

 > sir.py <- .Python("model",.module="sir")
Error in .Python("model", .module = "sir") : No such module

Any help would be most appreciated.

Best wishes
Simon

-- 
Simon D.W. Frost, D.Phil.
Senior Lecturer
Department of Veterinary Medicine
University of Cambridge
Madingley Road
Cambridge CB3 0ES
U.K.

Tel: +44 (0)1223 764201
Fax: +44 (0)1223 765760
Email: sdf22 at cam.ac.uk




More information about the R-help mailing list