I have tried every install method I can think of to install RPy2 on our debian server and I get the same message regardless. I have installed and used it successfully on my mac.
If you compile R with
./configure --enable-R-shlib
, then R is installed in /usr/local/lib/R
So you can add this lines to .bashrc, for you and root user
export R_HOME=/usr/local/lib/R
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$R_HOME/lib
Then you can install from pip or build from tarball
Please try
sudo apt-get install python-rpy2
(or use whichever packaging frontend you prefer) as the package exists within the distribution.
As pointed in rpy2 installation on Ubuntu, sometimes a missing python-dev (python-devel in RHEL) may cause these issues. You can fix by either
sudo apt-get install python-dev
or
sudo yum install python-devel
Or other OS specific instruction for installing python-dev[el]