rpy2 安装错误(操作系统:linux mint 17 | R 3.1.2 | python 2.7.6) [英] rpy2 installation error (OS: linux mint 17 | R 3.1.2 | python 2.7.6)

查看:84
本文介绍了rpy2 安装错误(操作系统:linux mint 17 | R 3.1.2 | python 2.7.6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 'sudo pip install rpy2' 时,我收到了很多编译错误.

When I run 'sudo pip install rpy2' I get the a lot of compilation errors.

这里是所有错误的完整转储,下面是一个示例,除了:

Here is the full dump of all the errors and here is an example except:

 Compilation parameters for rpy2's C components:
        include_dirs    = ['/usr/share/R/include']
        library_dirs    = ['/usr/lib/R/lib']
        libraries       = ['R', 'pcre', 'lzma', 'bz2', 'z', 'rt', 'dl', 'm']
        extra_link_args = ['-Wl,--export-dynamic', '-fopenmp']

R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
building 'rpy2.rinterface._rinterface' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/usr/share/R/include -I/usr/include/python2.7 -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-2.7/./rpy/rinterface/_rinterface.o
In file included from /usr/share/R/include/R.h:46:0,
                 from ./rpy/rinterface/_rinterface.h:8,
                 from ./rpy/rinterface/_rinterface.c:58:
/usr/share/R/include/R_ext/Memory.h:40:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 int R_gc_running();
 ^
In file included from ./rpy/rinterface/_rinterface.h:9:0,
                 from ./rpy/rinterface/_rinterface.c:58:
/usr/share/R/include/Rinternals.h:831:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 const char *R_curErrorBuf();
 ^
In file included from ./rpy/rinterface/_rinterface.c:70:0:
/usr/share/R/include/Rinterface.h:129:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 extern void (*ptr_R_ProcessEvents)();
 ^
In file included from ./rpy/rinterface/_rinterface.c:79:0:
/usr/share/R/include/R_ext/Rdynload.h:32:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 typedef void * (*DL_FUNC)();
 ^
./rpy/rinterface/_rinterface.c:86:31: fatal error: readline/readline.h: No such file or directory
 #include <readline/readline.h>
                               ^
compilation terminated.

一些背景.以前搞砸了 ipython notebook 开发版本的安装,并已恢复到 pip 存储库版本.不确定这是否起作用.在此之前能够让 R 魔法发挥作用.

Some background. Previously botched the installation of ipython notebook dev version and have reverted back to the pip repository version. Not sure if that plays a role. Was able to get R magic working a little before that.

我已经确保运行'apt-get updates'、'pip uninstall rpy2'、'apt-get purge python-rpy2 &&在尝试重新安装之前 apt-get 删除 python-rpy2'.为了检查是否有任何残留文件,我在 ipython 中运行了import rpy2",这导致了一个未找到模块的错误(很好,没有任何拖延).

I had made sure to run 'apt-get updates', 'pip uninstall rpy2', 'apt-get purge python-rpy2 && apt-get remove python-rpy2' before attempt to re-install. To check if there was any residual files, I ran 'import rpy2' in ipython and that resulted in an module not found error (good, nothing was lingering).

不确定从哪里开始故障排除.建议表示赞赏.

Not sure where to begin troubleshooting. Advice is appreciated.

2014 年 11 月 26 日

Nov 26, 2014

它在安装以下依赖项后工作:

It worked after installing the following dependencies:

  • apt-get install libreadline-dev
  • apt-get install r-base r-base-dev python-dev python-setuptools

推荐答案

您需要 readline 库的标题:

You need the headers for the readline library:

apt-get install libreadline-dev

这篇关于rpy2 安装错误(操作系统:linux mint 17 | R 3.1.2 | python 2.7.6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆