簡體   English   中英

在 R 中安裝插入符號包時的依賴性問題

[英]Dependency issue while installing caret package in R

我正在嘗試安裝 R 包caret

這給了我ERROR: dependencies 'ggplot2', 'reshape2', 'BradleyTerry2' are not available for package 'caret'

我嘗試單獨安裝每個,這再次顯示安裝正在進行,以消息installation of package 'X' had non-zero exit status

1: In install.packages("caret") :
  installation of package ‘minqa’ had non-zero exit status
2: In install.packages("caret") :
  installation of package ‘RcppEigen’ had non-zero exit status
3: In install.packages("caret") :
  installation of package ‘scales’ had non-zero exit status
4: In install.packages("caret") :
  installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("caret") :
  installation of package ‘lme4’ had non-zero exit status
6: In install.packages("caret") :
  installation of package ‘ggplot2’ had non-zero exit status
7: In install.packages("caret") :
  installation of package ‘BradleyTerry2’ had non-zero exit status
8: In install.packages("caret") :
  installation of package ‘caret’ had non-zero exit status

遞歸請求安裝一些包。 問題是什么?

我有舊版本,在那里我遇到了類似的錯誤。 我刪除並安裝了最新版本。 當前版本是R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" ,但仍然收到類似的錯誤消息

更新

開始於: install.packages('caret', repos='http://cran.rstudio.com/')顯示消息:

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘minqa’, ‘RcppEigen’, ‘scales’, ‘lme4’, ‘ggplot2’, ‘reshape2’, ‘BradleyTerry2’

過程結束於:

installing to /usr/local/lib/R/site-library/reshape2/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error : package ‘stringr’ was built before R 3.0.0: please re-install it
ERROR: lazy loading failed for package ‘reshape2’
* removing ‘/usr/local/lib/R/site-library/reshape2’
ERROR: dependencies ‘minqa’, ‘RcppEigen’ are not available for package ‘lme4’
* removing ‘/usr/local/lib/R/site-library/lme4’
ERROR: dependencies ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/usr/local/lib/R/site-library/ggplot2’
ERROR: dependency ‘lme4’ is not available for package ‘BradleyTerry2’
* removing ‘/usr/local/lib/R/site-library/BradleyTerry2’
ERROR: dependencies ‘ggplot2’, ‘reshape2’, ‘BradleyTerry2’ are not available for package ‘caret’
* removing ‘/usr/local/lib/R/site-library/caret’

The downloaded source packages are in
    ‘/tmp/RtmpcLo8Rw/downloaded_packages’
Warning messages:
1: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘minqa’ had non-zero exit status
2: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘RcppEigen’ had non-zero exit status
3: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘scales’ had non-zero exit status
4: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘lme4’ had non-zero exit status
6: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘ggplot2’ had non-zero exit status
7: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘BradleyTerry2’ had non-zero exit status
8: In install.packages("caret", repos = "http://cran.rstudio.com/") :
  installation of package ‘caret’ had non-zero exit status

正如插入符號文檔建議執行install.packages("caret", dependencies = c("Depends", "Suggests"))以確保安裝所有需要的包並解決所有依賴項

當我安裝插入符號包時,我遇到了類似的問題。 我發現的問題是由更新包依賴引起的。 更新一些包也會改變它們的依賴項,這些依賴項可能沒有正確的版本供以后在其他包中使用。 就像我安裝插入符號時一樣,它顯示:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called minqa?

我找到的解決方案是首先找到導致問題的包。 您只需安裝所需的軟件包即可獲取此信息。 對我來說,一個是“minqa”。 所以只需獨立安裝這個包。

install.packages("minqa")

我的問題就這樣解決了。

對於你,你需要一一安裝“'minqa'、'RcppEigen'、'scales'、'lme4'、'ggplot2'、'reshape2'、'BradleyTerry2'”。

我在嘗試在 R 上安裝插入符號時遇到了類似的依賴問題:

> install.packages("caret", contriburl = "file:///usr/repo_AO/CRAN/")
ERROR: dependency ‘car’ is not available for package ‘caret’

> install.packages("car", contriburl = "file:///usr/repo_AO/CRAN/")
Installing package into ‘/usr/share/R/library-users’
(as ‘lib’ is unspecified)
Warning message:
package ‘car’ is not available (for R version 3.1.2) 

'car' package is for >= R 3.2
> R.version                
version.string R version 3.1.2 (2014-10-31)

我發現,一旦我從操作系統安裝了來自 R-car-2.0_21-1.8.x86_64.rpm 包的舊“汽車”版本,“插入符號”就不再要求依賴了:

$ sudo yum install --nogpgcheck R-car-2.0_21-1.8.x86_64.rpm
Setting up Install Process
Examining R-car-2.0_21-1.8.x86_64.rpm: R-car-2.0_21-1.8.x86_64
Marking R-car-2.0_21-1.8.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package R-car.x86_64 0:2.0_21-1.8 will be installed
--> Finished Dependency Resolution
---8<---
Installed:
  R-car.x86_64 0:2.0_21-1.8                                                              
    Complete!

然后:

    > install.packages("caret", contriburl = "file:///usr/repo_AO/CRAN/")
    Installing package into ‘/usr/share/R/library-users’
    (as ‘lib’ is unspecified)
    also installing the dependency ‘ggplot2’
    * installing *source* package ‘ggplot2’ ...
    ** package ‘ggplot2’ successfully unpacked and MD5 sums checked
    ----8<----
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded
    * DONE (ggplot2)
    * installing *source* package ‘caret’ ...
    ** package ‘caret’ successfully unpacked and MD5 sums checked
    ** libs
    gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c caret.c -o caret.o
    gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o caret.so caret.o -L/usr/lib64/R/lib -lR
    installing to /usr/share/R/library-users/caret/libs
    ----8<----
    ** testing if installed package can be loaded
    * DONE (caret)

(*) 我使用了本地存儲庫,因為沒有直接的互聯網連接,但存儲庫位置無關緊要。

  • 在 Linux Mint 17.3 KDE“Rosa”(64 位)、x86_64-pc-linux-gnu、
  • 安裝 R 版本 3.3.0 (2016-05-03) 后——“據稱具有教育意義”。

我在幾個包裹(汽車、素食、心理……)上遇到了類似的問題。 它是通過在命令行(終端)中運行來解決的:

sudo apt-get install r-base-dev

R

> install.packages("car")

蘇爾特!

我有一個類似的問題。 我用了

install.packages("caret", dependencies = c("Depends"), repos='http://cran.rstudio.com/')
並得到
ERROR: dependency 'car' is not available for package 'caret'
通過 R 單獨安裝汽車不起作用,但使用我的發行版(Fedora)的包管理器
dnf install R-car

那么第一個命令就成功了。

我也有插入符號包安裝的類似問題。

我使用 Linux Mint 17.3 Cinnamon 64 位:

  • R 版本 3.3.0 (2016-05-03)
  • 平台:x86_64-pc-linux-gnu(64 位)
  • 運行於:Ubuntu 14.04.4 LTS

使用命令進行第一個插入符號安裝

install.packages('caret', repos='http://cran.rstudio.com/')

給出的錯誤信息如下...

* installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c altmov.f -o altmov.o
/bin/bash: gfortran: command not found
make: *** [altmov.o] Error 127
ERROR: compilation failed for package ‘minqa’
* removing ‘/home/myusername/R/x86_64-pc-linux-gnu-library/3.3/minqa’
Warning in install.packages :
  installation of package ‘minqa’ had non-zero exit status
* installing *source* package ‘RcppEigen’ ...
** package ‘RcppEigen’ successfully unpacked and MD5 sums checked
** libs

...

/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [RcppEigen.so] Error 1
ERROR: compilation failed for package ‘RcppEigen’

...

然后我試着跑

install.packages("RcppEigen")

但它不起作用,並給出了關於 llapack 等的相同錯誤。接下來我在 linux 命令行上運行:

sudo apt-get install liblapack-dev

(這會安裝必要的庫)

然后命令

install.packages("RcppEigen") 

工作得很好,也是如此

install.packages('caret', repos='http://cran.rstudio.com/')

所以這個 liblapack-dev 是對我的回答。

快樂的結局並感謝您在本次討論中的提示!

我遇到了典型的問題。
當我開始加載依賴包時,我發現錯誤:
was installed by an R version with different internals

重新安裝這些軟件包對我有幫助

我之前在 Linux 上安裝過它,它可以工作:
sudo apt-get install -y r-cran-rcppeigen

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM