[R] problem driving R from Python

Duncan Temple Lang duncan at research.bell-labs.com
Thu Jan 24 11:48:52 CET 2002


A quick guess would be that R was not built as a shared library.
Specifically, does the file $R_HOME/bin/libR.so exist?
If not, you can rebuild R with

  cd $R_HOME
  ./configure  --enable-R-shlib
  make

and then re-install RSPython.

Another diagnostic is to look at the link command during the
installation of the RSPython package and see if `-lR' is in included
in the command.

The RSPython package is a two-headed monster because it allows Python
to be run in R, and/or R to be run in Python. The latter requires R as
a shared library, the former doesn't.

If libR.so exists and is used in the compilation, then we can try to 
figure out what else might be wrong.

 D.

mikalzet at libero.it wrote:
> 
> I tried installing RSPython ( R 1.4.0, linux mandrake 8.1).
> Bash shell.
> 
> export PYTHON_INCLUDE_DIR=/usr/lib/python2.1
> 
> R INSTALL --clean RSPython_0.3-0.tar.gz \
> --configure-args=--with-pylib=/usr/lib/python2.1
> 
> ................
> .........
> 
> DONE (RSPython)
> 
> DONE (INSTALL)
> 
> export R_HOME=/usr/lib/R
> export PYTHONPATH=${R_HOME}/library/RSPython/Python
> export PYTHONPATH=${PYTHONPATH}:${R_HOME}/library/RSPython/libs
> export LD_LIBRARY_PATH=${R_HOME}/bin
> 
> python
> 
> >>> import RS
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/R/library/RSPython/Python/RS.py", line 1, in ?
>     import RSInternal
> ImportError: /usr/lib/R/library/RSPython/libs/RSInternal.so: undefined
> symbol: R_GlobalEnv
> 
> 
> What's wrong here ?
> 
> -- 
> Michele Alzetta
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list