Unable to install certain packages

Hi all,

I'm trying to download some packages, but I get the same error everytime:
EXAMPLE:

install.packages("jtools")
Installing package into ‘C:/Users/Iris/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)

However, it starts downloading after all, but then this happens:

install.packages("jtools")
Installing package into ‘C:/Users/Iris/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘ggplot2’

There are binary versions available but the source versions are later:
binary source needs_compilation
ggplot2 3.1.1 3.3.2 FALSE
jtools 2.0.0 2.1.0 FALSE

installing the source packages ‘ggplot2’, ‘jtools’

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.3.2.tar.gz'
Content type 'application/x-gzip' length 3054431 bytes (2.9 MB)
downloaded 2.9 MB

trying URL 'https://cran.rstudio.com/src/contrib/jtools_2.1.0.tar.gz'
Content type 'application/x-gzip' length 4395392 bytes (4.2 MB)
downloaded 4.2 MB

  • installing source package 'ggplot2' ...
    ** package 'ggplot2' successfully unpacked and MD5 sums checked
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** preparing package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    there is no package called 'pillar'
    ERROR: lazy loading failed for package 'ggplot2'
  • removing 'C:/Users/Iris/Documents/R/win-library/3.4/ggplot2'
    In R CMD INSTALL
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\Iris\Documents\R\win-library\3.4" C:\Users\Iris\AppData\Local\Temp\Rtmpwth2f2/downloaded_packages/ggplot2_3.3.2.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status
    ERROR: dependency 'ggplot2' is not available for package 'jtools'
  • removing 'C:/Users/Iris/Documents/R/win-library/3.4/jtools'
    In R CMD INSTALL
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\Iris\Documents\R\win-library\3.4" C:\Users\Iris\AppData\Local\Temp\Rtmpwth2f2/downloaded_packages/jtools_2.1.0.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘jtools’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\Iris\AppData\Local\Temp\Rtmpwth2f2\downloaded_packages’

If anyone could help me I would be very happy! Since I really need this package

Thank you in advance :slight_smile:

I searched this post for the first 'ERROR' and found

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

This implies you should try to install.packages("pillar") before going back and trying to install jtools again

try updating your r vesion and rstudio too
then retry installing the packages

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

Thank you for your quick response,

My biggest problem is that I get these errors with almost every package I try to install:

install.packages("pillar")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Iris/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rlang’, ‘ellipsis’, ‘lifecycle’, ‘vctrs’

There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.3.4 0.4.7 TRUE
ellipsis 0.1.0 0.3.1 TRUE
vctrs 0.1.0 0.3.1 TRUE
pillar 1.3.1 1.4.6 FALSE

Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB

trying URL
Content type 'application/zip' length 30847 bytes (30 KB)
downloaded 30 KB

trying URL
Content type 'application/zip' length 499748 bytes (488 KB)
downloaded 488 KB

package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘ellipsis’ successfully unpacked and MD5 sums checked
package ‘vctrs’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Iris\AppData\Local\Temp\RtmpQl6BKm\downloaded_packages
installing the source packages ‘lifecycle’, ‘pillar’

trying URL
Content type 'application/x-gzip' length 164455 bytes (160 KB)
downloaded 160 KB

trying URL '
Content type 'application/x-gzip' length 113884 bytes (111 KB)
downloaded 111 KB

  • installing source package 'lifecycle' ...
    ** package 'lifecycle' successfully unpacked and MD5 sums checked
    ** R
    ** inst
    ** preparing package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 0.3.4 is being loaded, but >= 0.4.0 is required
    ERROR: lazy loading failed for package 'lifecycle'
  • removing 'C:/Users/Iris/Documents/R/win-library/3.4/lifecycle'
    In R CMD INSTALL
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\Iris\Documents\R\win-library\3.4" C:\Users\Iris\AppData\Local\Temp\RtmpQl6BKm/downloaded_packages/lifecycle_0.2.0.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘lifecycle’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'pillar'
  • removing 'C:/Users/Iris/Documents/R/win-library/3.4/pillar'
    In R CMD INSTALL
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\Iris\Documents\R\win-library\3.4" C:\Users\Iris\AppData\Local\Temp\RtmpQl6BKm/downloaded_packages/pillar_1.4.6.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘pillar’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\Iris\AppData\Local\Temp\RtmpQl6BKm\downloaded_packages’

rlang .3.4 was installed from binary rather than the needed 0.4.7

If was you I would install R version 4, and the Rtools utility for version 4, and start again.
Also I personally use the renv package to handle my installs .
I think your R version of 3.4 is holding you back , but at a minimum give yourself to a chance to compile from source by having the appropriate Rtools utility
https://cran.r-project.org/bin/windows/Rtools/history.html

Thank you!

Have you ever worked with a negative binomial regression model before?
I could really use some help with it...

you can make a new post about what you are doing and your problems.
probably this post will only be seen by those with an interest in reading about installation issues.