Reputation: 42329
I'm running Python v2.7.8
and R v3.0.2 (2013-09-25) -- "Frisbee Sailing"
on my elementary OS Freya 64 bit (based on Ubuntu 14.04).
I'm trying to install the rpy2
package with:
pip install rpy2
and it fails with the error:
Failed building wheel for rpy2
Down below I also see:
error: command 'gcc' failed with exit status 1
The full output is here.
I've already tried:
sudo apt-get install python-dev libevent-dev python3-dev
but the error remains.
I know pip
works because I've already installed numpy
, matplotlib
, scipy
, and other packages using it.
Upvotes: 5
Views: 9306
Reputation: 752
First upgrade the pip version
pip install --upgrade pip
Then install system dependencies (Ubuntu)
sudo apt-get install -y libssl-dev libffi-dev libxml2-dev libxslt1-dev libopenblas-dev
Then try to install again
pip install rpy2
Upvotes: 0
Reputation: 43
For people wondering, in Fedora, you need to install this package:
sudo dnf install python3-devel
This will solve the problem if you have a header issue!
Pip is trying to compile rpy2
, thus it needs a header file.
The header file is within this package!
Upvotes: 1
Reputation: 2621
This solution worked for me because it's actually a header issue: https://stackoverflow.com/a/23085474/7049567
sudo apt-get install libreadline-dev
Or
yum install readline-devel
Upvotes: 0
Reputation: 42329
Found the answer in this post. I just had to upgrade R from v3.0.2
to the latest version available for my system (v3.2.1
).
sudo apt-get remove r-base-core
Edit the sources.list file
sudo gedit /etc/apt/sources.list
Add following entry (for Ubuntu 14.04):
deb http://cran.rstudio.com/bin/linux/ubuntu trusty/
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base
pip install rpy2
Upvotes: 7
Reputation: 11545
It is indicated in the full output.
It has to do with how R was compiled and/or installed. Rpy2 is expecting a header that cannot be found:
./rpy/rinterface/r_utils.c:32:31: fatal error: R_ext/Rallocators.h: No existe el archivo o el directorio
#include <R_ext/Rallocators.h>
Upvotes: 2