Installation

Before pyRserve can be used, R and Rserv have to be installed properly. Installation instructions for both packages are available on their corresponding websites at http://www.r-project.org/ and http://www.rforge.net/Rserve/

Installing R from sources

For R being able to run Rserve properly it has to be installed with the --enable-R-shlib option.

The following command show how to do this for the sources. Make sure you have a fortran compiler installed, otherwise installation will not be possible.

On Unix this looks like:

curl -O https://cran.r-project.org/src/base/R-4/R-4.1.0.tar.gz
tar -xzf R-4.1.0.tar.gz       # or whatever version you are using
cd R-4.1.0
./configure --enable-R-shlib
make
make install

For Windows it might be just enough to install a prebuilt R package. The same might be true for some Linux distributions, just make sure to install a version which also contains all headers necessary for compiling Rserve in the next step.

Installing Rserve

If you have already downloaded the tar file then from your command line run:

curl -O http://www.rforge.net/Rserve/snapshot/Rserve_1.8-8.tar.gz
R CMD INSTALL Rserve_1.8-8.tar.gz

Older versions of Rserve might also work, the earliest function version however seems to be 0.6.6.

Note

Rserve usually daemonizes itself after starting from the command line. If you want to prevent this from happening (e.g. because you would like to control Rserve by a process management tool like supervisord) then Rserve has to be install with the special -DNODAEMON compiler flag:

PKG_CPPFLAGS=-DNODAEMON  R CMD INSTALL Rserve_1.8-8.tar.gz

Installing pyRserve

From your unix/windows command line run:

pip install pyRserve

If you want to develop or test locally, then also install extra packages for testing:

pip install pyRserve[testing]

Currently supported Python versions are 2.7, 3.6 to 3.9.

In the next section you’ll find instructions how to use everything together.