Alcides Fonseca

40.197958, -8.408312

How to install RPy2 on Mac OS 10.6

How to install the R python bindings library RPy2 on Mac OS 10.6 Snow Leopard using Homebrew.

Install R

In order to install R in your Mac as a framework, make this change in your homebrew/Library/Formula

brew install r

Install RPy2

wget http://pypi.python.org/packages/source/r/rpy2/rpy2-2.1.4.tar.gz#md5=cf4e0d80ba498a6d76f107531966478d
tar xfz rpy2-2.1.4.tar.gz
cd rpy2-2.1.4/
sudo python setup.py build --r-home /usr/local/Cellar/r/2.11.1/R.framework/Resources/ install

Troubleshooting

If you are having a problem related to “-framework vecLib” when installing rpy2, insert a new line after #134 of setup.py with the following:

extra_link_args = extra_link_args[:-1]

Worked for me.