Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I try to install rpy2 in my system, (I compile R with --enable-R-shlib and with --enable-BLAS-shlib flags) but when I try in python console

import rpy2 import rpy2.robjects

I got:

Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/dist-packages/rpy2/robjects/init.py", line 14, in import rpy2.rinterface as rinterface File "/usr/lib/python2.6/dist-packages/rpy2/rinterface/init.py", line 75, in from rpy2.rinterface.rinterface import * ImportError: libRblas.so: cannot open shared object file: No such file or directory

The rpy2 directory is:

rpy2.path

['/usr/lib/python2.6/dist-packages/rpy2']

My R version is: R version 2.12.1 Patched (2011-01-04 r53913)

My R home is: /usr/bin/R

My ubuntu version is: Linux kenneth-desktop 2.6.32-27-generic #49-Ubuntu SMP Thu Dec 2 00:51:09 UTC 2010 x86_64 GNU/Linux

My Python version is: Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2

When I install rpy2 from source (sudo python setup.py build install) I got:

running build running build_py running build_ext Configuration for R as a library: include_dirs: ('/usr/lib64/R/include',) libraries: ('R', 'Rblas', 'Rlapack') library_dirs: ('/usr/lib64/R/lib',) extra_link_args: () # OSX-specific (included in extra_link_args) framework_dirs: () frameworks: () running install running install_lib running install_data running install_egg_info Removing /usr/local/lib/python2.6/dist-packages/rpy2-2.1.9.egg-info Writing /usr/local/lib/python2.6/dist-packages/rpy2-2.1.9.egg-info

What am I doing wrong?

Thank you for your help.

share|improve this question

1 Answer

It looks like you tried to do things locally but didn't quite get there. I happen to maintain the Debian packages of R (which get rebuilt for Ubuntu and are accessible at CRAN. These builds use external BLAS. rpy2 then builds just fine as well.

I would recommend that you read the README, try to install r-base-core and r-base-dev from the repositories and then try to install rpy2 from source. Or live with the slightly older rpy2 package in Ubuntu.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.