I'm getting the following error when trying to install rpy2 on my Mac.
$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 153, in <module>
ri_ext = getRinterface_ext(RHOME, r_packversion)
File "setup.py", line 139, in getRinterface_ext
get_rconfig(RHOME, 'BLAS_LIBS'),
File "setup.py", line 85, in get_rconfig
raise Exception(cmd + '\nreturned\n' + rconfig)
Exception: "/opt/local/lib/R/bin/R" CMD config BLAS_LIBS
returned
This happens whether I use easy_install or the command-line install.
I'm trying to install the latest rpy2 (rpy2-2.0.8).
I'm using Python 2.5.4 |EPD 5.1.1| (r254:67916, Jul 20 2009, 15:41:21),
though the problem also occurs when I use Python 2.6.4 (r264:75706, Nov 6 2009, 10:44:01) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin.
I have tried to do my homework and solve this myself, but have had no luck.
A similar problem has been addressed here:
https://sourceforge.net/tracker/?func=detail&atid=453022&aid=2721281&group_id=48422
but that involved Fink (which I'm not using) and the problem was apparently since fixed.
Any help would be much appreciated - I dearly miss this package.
(it used to work, before I started over from scratch with Snow Leopard a few months ago)
Anonymous
The problem occurs when the setup script tries to obtain informations from R
(the exception says that a call to R CMD config returned an empty string)
Can you open a terminal and investigate why the following does not return anything ?
"/opt/local/lib/R/bin/R" CMD config BLAS_LIBS
Thank you (thank you!) for helping - it would help me very greatly to have this working again.
I agree that R is not returning information regarding it's BLAS_LIBS config, although I cannot figure out why. I tried some associated queries below - hopefully it will help.
R is version 2.9.2 (2009-08-24)
$ "/opt/local/lib/R/bin/R" CMD config BLAS_LIBS
$ "/opt/local/lib/R/bin/R" CMD config LAPACK_LIBS
-L/opt/local/lib/R/lib -lRlapack
$ "/opt/local/lib/R/bin/R" CMD config LDFLAGS
-L/opt/local/lib
Is there a way I can set the BLAS_LIBS in R? I looked and looked, but was unsuccessful - not surprising in the setting of my lack of understanding...
Where is your R coming from ?
Did you compile it yourself or installed pre-built binaries (and if yes, from where) ?
I have R installed from MacPorts
http://trac.macports.org/browser/trunk/dports/math/R/Portfile
(that was version 2.9.2, currently upgrading to 2.10.0 but not done yet)
I also have R 2.10.0 installed from CRAN binary:
http://cran.fhcrc.org/bin/macosx/ (or more specifically http://cran.fhcrc.org/bin/macosx/R-2.10.0.pkg)
2.10.0 is what runs from the GUI. 2.9.2 runs from the command line.
I downloaded 2.10.0 and tried to ./configure and make it myself, but it it crashes in ./configure here:
checking for dummy main to link with Fortran 77 libraries... rm: conftest.dSYM: is a directory
none
checking for Fortran 77 name-mangling scheme... rm: conftest.dSYM: is a directory
unknown
configure: WARNING: unknown Fortran name-mangling scheme
checking whether gfortran appends underscores to external names... unknown
configure: error: cannot use Fortran
Argh.
Well, changing to R 2.10.0 (installed by MacPorts) did not fix the problem.
I confirmed that "/opt/local/lib/R/bin/R" points to 2.10.0
but
"/opt/local/lib/R/bin/R" CMD config BLAS_LIBS
still returns nothing
I'd suggest you try one of the following:
a- desinstall macports R and install the R binary from CRAN, then install rpy2 again
(note: the CRAN binary should be at /usr/bin/R)
b- download rpy2 from macports (since they package rpy2)
I uninstalled MacPorts completely and it still failed, because python was pointing at Python 2.5.4 -- EPD 5.1.1.
The following command worked:
$ sudo python2.6 setup.py install
running install
running build
running build_py
running build_ext
running install_lib
running install_data
creating /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
creating /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rpy2
creating /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rpy2/images
copying doc/source/rpy2_logo.png -> /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rpy2/images
running install_egg_info
Writing /Library/Python/2.6/site-packages/rpy2-2.0.8-py2.6.egg-info
I'll get rid of EPD (Enthought Python Distribution) and leave MacPorts dead - rpy2 is more important currently. Thanks so much for your help.