Installation of package ‘forecast’ had non-zero exit status

百般思念 提交于 2019-12-20 03:15:34

问题


With R version 3.2.3 (2015-12-10) on centOS I am trying to install.packages('forecast')

I get this:

install.packages('forecast')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘RcppArmadillo’

trying URL 'http://mirrors.ebi.ac.uk/CRAN/src/contrib/RcppArmadillo_0.6.700.3.0.tar.gz'

Content type 'application/x-gzip' length 1002967 bytes (979 KB)

downloaded 979 KB

trying URL 'http://mirrors.ebi.ac.uk/CRAN/src/contrib/forecast_7.1.tar.gz'

Content type 'application/x-gzip' length 196896 bytes (192 KB)

downloaded 192 KB

Error in plota.theme(col.border = rgb(68, 68, 68, maxColorValue = 255), :
could not find function "rgb"
Calls: source ... eval -> eval -> plota.theme.green.orange -> plota.theme
Execution halted
Error in plota.theme(col.border = rgb(68, 68, 68, maxColorValue = 255), :
could not find function "rgb"
Calls: source ... eval -> eval -> plota.theme.green.orange -> plota.theme
Execution halted

The downloaded source packages are in
‘/tmp/Rtmp0jOTCu/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("forecast") :
installation of package ‘RcppArmadillo’ had non-zero exit status
2: In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status

I tried every solution to fix this like install package from source indicate the dependency = TRUE, etc., but nothing works.

sessionInfo() give this output

R version 3.2.3 (2015-12-10)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)

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


回答1:


On UBUNTU 18.04 I got the following

Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) * rpm: libcurl-devel (Fedora, CentOS, RHEL) * csw: libcurl_dev (Solaris)

I installed the package libcurl14-openssl-dev using synaptic, that solved the problem.




回答2:


Install devtools. Most of the time the problem in installing R packages is that these tools are not there. Once this is installed, the zero exit error goes away.

install.packages('devtools')

https://www.digitalocean.com/community/tutorials/how-to-install-r-packages-using-devtools-on-ubuntu-16-04



来源:https://stackoverflow.com/questions/36935348/installation-of-package-forecast-had-non-zero-exit-status

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!