Dependency problem when installing caret package in R

I am trying to install the R caret package

Which gives me ERROR: dependencies 'ggplot2', 'reshape2', 'BradleyTerry2' are not available for package 'caret'

I tried to install each of them separately, which again shows the installation, ending with the message that 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 

Ask to install some package recursively. What is the problem?

I had an older version where I was getting a similar error. I uninstalled and installed the latest version. Currently, version R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" but a similar error message still appears

UPDATE

First, use install.packages('caret', repos='http://cran.rstudio.com/') , which displays the message:

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

and the process ends with:

 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 
+5
source share
6 answers

I have the same problem when I installed the caret package. The problem I discovered was caused by updating the package dependency. Updating some packages will also change their dependency, which may not have the correct version for later use in other packages. For example, when I install the carriage, it shows:

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

The solution I found is to first find which package is causing the problem. You can get this information, just install the required package. For me it's a mink. Therefore, just install this package yourself.

 install.packages("minqa") 

My problem is solved this way.

For you you need to set "minqa", "RcppEigen", "scales", "lme4", "ggplot2", "reshape2", "BradleyTerry2" in turn.

+8
source

As shown in the carriage documentation , execute install.packages("caret", dependencies = c("Depends", "Suggests")) to make sure that all necessary packages are installed and all dependencies are resolved

+8
source

I ran into similar dependency problems while trying to set the carriage on 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) 

I found that “caret” no longer requested dependencies after installing from the OS an older version of the “car” from the R-car-2.0_21-1.8.x86_64.rpm package:

 $ 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! 

Then:

  > 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) 

(*) I used the local repository because there is no direct Internet connection, but the location of the repo does not matter.

+2
source
  • On Linux Mint 17.3 KDE "Rose" (64 bit), x86_64-pc-linux-gnu,
  • After installing R version 3.3.0 (2016-05-03) - "Presumably educational."

I had problems with several packages (car, vegan, crazy, ...). It was resolved by running on the command line (Terminal):

sudo apt-get install r-base-dev

R

> install.packages("car")

Suerte!

+1
source

I had a similar problem. I used

install.packages("caret", dependencies = c("Depends"), repos='http://cran.rstudio.com/')
and got ERROR: dependency 'car' is not available for package 'caret'
Installing a car separately through R did not work, but with the package manager of my distribution kit (Fedora)
dnf install R-car

Then the first team was successful.

0
source

I also had a similar problem installing caret package.

I am using Linux Mint 17.3 Cinnamon 64-bit:

  • R version 3.3.0 (2016-05-03)
  • Platform: x86_64-pc-linux-gnu (64-bit)
  • Works under: Ubuntu 14.04.4 LTS

First carriage setup using the command

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

provided error messages as follows ...

 * 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' 

...

Then I tried to run

 install.packages("RcppEigen") 

But this did not work and produced the same errors regarding llapack, etc. Then I ran the linux command line:

 sudo apt-get install liblapack-dev 

(install the necessary libraries)

And after that the team

 install.packages("RcppEigen") 

worked very well as well

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

So this liblapack-dev answered me.

Happy ending and thanks for the tips in this discussion!

0
source

Source: https://habr.com/ru/post/1209053/


All Articles