Installation of packages and non-zero exit status?

Hi everyone!
I'm on a beginners course for data analysis, and currently installing packages. I had no problem with installing tidyverse and devtools, but wordbankr showed non-zero exit statuses on many of its sub-packages (reprex below). I have no idea what this code means, but i want to understand what happened. I know that the non-zero exit means the packages were not installed, and it can be due to unresolved dependencies. I've tried to understand what that means (something that is present in the repository but not deployment set?) but I'm not getting it.

I read that wordbankr was removed from the CRAN respository. Is this the reason for the result?

If so, do you have advice on other packages that include the same sub-packages included in wordbankr? (such as MatrixModels, SparseM, purrr, etc).

As is evident from this post, my base knowledge is just taking form, so please keep that in mind!
Thanks for your patience :slight_smile:

devtools::install_version("wordbankr", version = "0.3.1", repos = "http://cran.us.r-project.org")
#> Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/wordbankr/wordbankr_0.3.1.tar.gz
#> MatrixModels (NA    -> 0.5-2  ) [CRAN]
#> SparseM      (NA    -> 1.81   ) [CRAN]
#> purrr        (1.0.1 -> 1.0.2  ) [CRAN]
#> quantreg     (NA    -> 5.96   ) [CRAN]
#> robustbase   (NA    -> 0.99-0 ) [CRAN]
#> RMySQL       (NA    -> 0.10.25) [CRAN]
#> quantregG... (NA    -> 1.7-0  ) [CRAN]
#> Installing 7 packages: MatrixModels, SparseM, purrr, quantreg, robustbase, RMySQL, quantregGrowth
#> Installing packages into 'C:/rlibs/4.3.1'
#> (as 'lib' is unspecified)
#> also installing the dependency 'Matrix'
#> Warning in i.p(...): installation of package 'Matrix' had non-zero exit status
#> Warning in i.p(...): installation of package 'SparseM' had non-zero exit status
#> Warning in i.p(...): installation of package 'purrr' had non-zero exit status
#> Warning in i.p(...): installation of package 'robustbase' had non-zero exit
#> status
#> Warning in i.p(...): installation of package 'RMySQL' had non-zero exit status
#> Warning in i.p(...): installation of package 'MatrixModels' had non-zero exit
#> status
#> Warning in i.p(...): installation of package 'quantreg' had non-zero exit
#> status
#> Warning in i.p(...): installation of package 'quantregGrowth' had non-zero exit
#> status
#> Installing package into 'C:/rlibs/4.3.1'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package
#> 'C:/Users/jaai/AppData/Local/Temp/RtmpgtYU3N/remotes4e0829c61df2/wordbankr' had
#> non-zero exit status

Created on 2023-08-14 with reprex v2.0.2

Try to call install.packages("Matrix") explicitly to see why it fails.

Maybe you don't have a C compiler?

Hi Gabor,
I tried installing Matrix as you suggested, and it seems to have worked? (see reprex below).

install.packages("Matrix")
#> Installing package into 'C:/rlibs/4.3.1'
#> (as 'lib' is unspecified)
#> package 'Matrix' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>  C:\Users\jaai\AppData\Local\Temp\RtmpWos757\downloaded_packages

Created on 2023-08-15 with reprex v2.0.2

If so, i can probably download the needed packages separately? Though I am still interested in learning why the earlier attempt resulted in a non-zero exit status.

Following this i tired installing wordbankr again, and it appears to give the same result sans the "Matrix" package (below).

devtools::install_version("wordbankr", version = "0.3.1", repos = "http://cran.us.r-project.org")
#> Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/wordbankr/wordbankr_0.3.1.tar.gz
#> SparseM      (NA    -> 1.81   ) [CRAN]
#> purrr        (1.0.1 -> 1.0.2  ) [CRAN]
#> quantreg     (NA    -> 5.96   ) [CRAN]
#> robustbase   (NA    -> 0.99-0 ) [CRAN]
#> RMySQL       (NA    -> 0.10.25) [CRAN]
#> quantregG... (NA    -> 1.7-0  ) [CRAN]
#> Installing 6 packages: SparseM, purrr, quantreg, robustbase, RMySQL, quantregGrowth
#> Installing packages into 'C:/rlibs/4.3.1'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package 'SparseM' had non-zero exit status
#> Warning in i.p(...): installation of package 'purrr' had non-zero exit status
#> Warning in i.p(...): installation of package 'robustbase' had non-zero exit
#> status
#> Warning in i.p(...): installation of package 'RMySQL' had non-zero exit status
#> Warning in i.p(...): installation of package 'quantreg' had non-zero exit
#> status
#> Warning in i.p(...): installation of package 'quantregGrowth' had non-zero exit
#> status
#> Installing package into 'C:/rlibs/4.3.1'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package
#> 'C:/Users/jaai/AppData/Local/Temp/RtmpScoLj1/remotes33a86dc54f32/wordbankr' had
#> non-zero exit status

Created on 2023-08-15 with reprex v2.0.2

Some text that does not show up when i call for the reprex report show the following errors ,either an error 127 that says compilation failed, or another citing unavailability of some dependencies for a certain package. Below is an example of this regarding RMySQL.


* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
** using staged installation
** libs
"C:/PROGRA~1/R/R-43~1.1/bin/x64/Rscript.exe" "../tools/winlibs.R" 3.2.5
gcc  -I"C:/PROGRA~1/R/R-43~1.1/include" -DNDEBUG -I../windows/libmariadbclient-3.2.5/include/mariadb    -I"c:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RMySQL-init.c -o RMySQL-init.o
/bin/sh: line 1: gcc: command not found
make: *** [C:/PROGRA~1/R/R-43~1.1/etc/x64/Makeconf:265: RMySQL-init.o] Error 127
ERROR: compilation failed for package 'RMySQL'
* removing 'C:/rlibs/4.3.1/RMySQL'

CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
ERROR: dependency 'SparseM' is not available for package 'quantreg'
* removing 'C:/rlibs/4.3.1/quantreg'

CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
ERROR: dependencies 'quantreg', 'SparseM' are not available for package 'quantregGrowth'
* removing 'C:/rlibs/4.3.1/quantregGrowth'

It gives the same error message regarding some wordbankr packages;

ERROR: dependencies 'quantregGrowth', 'RMySQL', 'robustbase' are not available for package 'wordbankr'
* removing 'C:/rlibs/4.3.1/wordbankr'

Does this give any answers to why the installations show a non-zero exit status? For clarity, i can also copy the whole chuck as it shows up when i try to install wordbankr.

Many thanks again.

I guess you can install the packages separately. I am not sure what is going on. It seems like the separate Matrix installation used a binary package, why devtools is trying to compile packages from source, and you don't have Rtools 43 installed.

Btw. why are you using a specific mirror for that installation?

You can also try using pak which is doing a better job in general than devtools/remotes:

install.packages("pak")
pak::pkg_install("wordbankr@0.3.1")

Hi!
Thanks for your advice, i'll look into pak.

I'm using the installation codes given for our course, so i have no answer to why it contains the use of a specific mirror for the installation. When do installing packages require mirrors usually?

Looking at a previous post in stack overflow, Maybe it has to do with making sure there aren't any problems for the installation regardless of which computer is used in the course?

They never do, for packages that are on CRAN.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.