无法在Linux Mint 17上安装R软件包 [英] Can't install R packages on Linux Mint 17

查看:107
本文介绍了无法在Linux Mint 17上安装R软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux Mint 17上运行R 3.1.2,尝试安装常用软件包时得到non-zero exit status.示例install.packages的完整输出如下:

Running R 3.1.2 on Linux Mint 17, I get a non-zero exit status when I try to install popular packages. The full output of an example install.packages attempt is as follows:

> install.packages("plyr")
Installing package into ‘/home/joe_kendrick/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 Kb)
opened URL
==================================================
downloaded 384 Kb

* installing *source* package ‘plyr’ ...
** package ‘plyr’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG   -I"/usr/lib/R/site-library/Rcpp/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
/bin/bash: g++: command not found
make: *** [RcppExports.o] Error 127
ERROR: compilation failed for package ‘plyr’
* removing ‘/home/joe_kendrick/R/x86_64-pc-linux-gnu-library/3.1/plyr’

The downloaded source packages are in
    ‘/tmp/RtmpXe52Mz/downloaded_packages’
Warning message:
In install.packages("plyr") :
  installation of package ‘plyr’ had non-zero exit status

对于我尝试安装的其他软件包,例如ggplot2vegan,我得到的消息基本上相同,尽管在许多情况下,它在尝试安装依赖项失败时更加冗长.

I get essentially the same message for other packages I attempt to install, eg ggplot2 and vegan, though in many cases it is more verbose as it tries and fails to install dependencies.

这似乎是一个普遍的问题,但其他人似乎有软件不足

This seems like a somewhat common issue, but others seem to have either outdated software or insufficient memory. I am running the latest stable release of both Mint and R, and I have plenty of RAM and a swap file, so I don't think either of these are causing my issue.

推荐答案

每个错误消息

 /bin/bash: g++: command not found

您需要安装C ++编译器.我将从其中之一开始:

you need to install a C++ compiler. I would start with one of these:

 sudo apt-get install build-essentials        # key tools

 sudo apt-get install r-base-dev              # many development tools for R

或者当然

 sudo apt-get install r-cran-rcpp             # to not install from source

尽管您获得的Rcpp可能比您需要的Rcpp要老.

though the Rcpp you get may be older than the one you need.

针对基于Debian的系统的用户,有一个列表r-sig-debian.

There is a list r-sig-debian for users of Debian-based systems.

这篇关于无法在Linux Mint 17上安装R软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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