R (Ubuntu) - 无法安装软件包“readr"和“欧盟统计局" [英] R (Ubuntu) - Can't install packages "readr" and "eurostat"
问题描述
我在 R 中安装eurostats"包时遇到问题.分解问题后,我推断问题出在readr"包上.尝试安装它,出现这种情况:
I have a problem with installing "eurostats" package in R. After breaking down the problem, I deduced that the problem lies with "readr" package. Trying to install it, this occurs:
* installing *source* package ‘readr’ ...
** libs
g++ -I/usr/share/R/include -DNDEBUG -I"/home/shiny/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/home/shiny/R/x86_64-pc-linux-gnu-library/3.3/BH/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c Collector.cpp -o Collector.o
之后,终端就像它处于活动状态一样冻结,但没有任何反应.在此之前,我有点处理语言环境设置(如果有帮助就提一下).我能够安装其他软件包.
after which the terminal just freezes as if it is active but nothing happens.Prior to this, I kind of tackled with locale settings (just mentioning it if it helps). I was able to install other packages.
我的 R 和 Linux 详细信息如下:
My R and Linux details are as follows:
sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] httr_1.2.1 R6_2.2.0 tools_3.3.2 withr_1.0.2
[5] curl_2.2 memoise_1.0.0 git2r_0.16.0 digest_0.6.10
[9] devtools_1.12.0
有人可以帮帮我吗?
推荐答案
你那台机器上的内存不足.所以你有两个选择:
You have insufficient RAM on that machine. So you have two options:
继续你正在做的事情并尝试从源代码编译,这将需要更多内存并且可能会失败
continue what you are doing and trying to compile from source, which will need more memory and is likely to fail
安装一个预构建的二进制文件 (!!),这样您就不必首先编译
install a prebuilt binary (!!) so that you do not have to compile in the first place
最简单的方法是这样的(当我在 Ubuntu 16.04 的 Docker 实例中执行此操作时,我只显示命令,而不是输出,并且我在帐户为 root<的 Docker 中执行此操作/code>;否则在前面加上
sudo
)
The easiest way is something like this (and I am showing only the commands, not the output while I do this in a Docker instance of Ubuntu 16.04, and I am doing this in Docker where the account is root
; otherwise add sudo
in front)
apt-get update # refresh
apt-get install software-properties-common
add-apt-repository -y "ppa:marutter/rrutter"
add-apt-repository -y "ppa:marutter/c2d4u"
apt-get update # now with new repos
apt-get install r-cran-readr
和 瞧 你有 readr 包.现在继续进行未打包为二进制文件的 eurostat,但由于其 C++ 代码,可能不需要读取器所需的更多资源.
and voila you have the readr package. Now proceed for eurostat which is not packaged as a binary, but may not require heavier resources which readr does due to its C++ code.
这篇关于R (Ubuntu) - 无法安装软件包“readr"和“欧盟统计局"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!