我运行sudo pip install rpy2
并得到以下错误输出。
./rpy/rinterface/r_utils.c:32:31: fatal error: R_ext/Rallocators.h: No such file or directory
#include <R_ext/Rallocators.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8KDxsc/rpy2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-06pcwE-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8KDxsc/rpy2
我尽力安装了所有相关依赖项。以下是我的版本:
selah@selah-OptiPlex-9020:~$ python --version
Python 2.7.6
selah@selah-OptiPlex-9020:~$ R --version
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
答案1
rpy2 的最新/当前版本需要较新版本的 R(R 的当前最新版本是 3.2.x)