Installing Rpy2 in Linux Mint

While installing Rpy2 on Linux Mint 17, I ran into the same problem described here. This was apparently a StackOverflow question at some point, but it was removed for some reason. Here’s my solution.

R version: 3.0.2
Python version: 2.7.6

Initially, I tried

$ pip install readline
$ pip install rpy2

But got the following (abridged) error.

/rpy/rinterface/_rinterface.c:86:31: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Cleaning up...
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 79: ordinal not in range(128)

Although the Rpy2 documentation just lists “readline” as a dependency, the python readline package is not sufficient. Instead try

$ sudo apt-get install libreadline-dev
$ pip install rpy2

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s