Skip to content Skip to sidebar Skip to footer

Importing Rpy Module Into Python

I'm trying to import the rpy1.0.3 module for python2.6.6 using: from rpy import * and getting this error: File 'C:\Python26\lib\site-packages\rpy.py', line 58, in

Solution 1:

The setup.py script is calling upon the rpy_tools.py script to gain access to the version number. It searches the output of R --version for a regular expression:

version = re.search(" +([0-9]\.[0-9]\.[0-9])", output)

However, R is now in version 2.13.0, so it won't be able to find a two-digit version number. Replace that line in rpy_tools.py with:

version = re.search(" +([0-9]+\.[0-9]+\.[0-9]+)", output)

You will also need to delete the rpy_tools.pyc file that is created by setup.py


Post a Comment for "Importing Rpy Module Into Python"