Please help! After downloading new version of R (4.0.0), I cannot download certain packages anymore

Hi everyone!

Today I downloaded a new version of R (4.0.0) because I thought it would help the packages that I am using run better. However, with me being a super noob apparently, I did not make sure that all my packages would be transferred to this new version of R. Now, when I am trying to download packages (like tidyverse), I get all sorts of errors and the package is not downloaded. Does anyone know what to do? I get a whole list of these errors you can see below:

1 Like

Can you copy and paste those all error messages here. Screen shots are not easy to read or work with.

However it looks like a lot of one or more prerequisite packages are not loading automatically as they are supposed to and you will need to install them manually. It will be a lot easier to diagnose the problem with a readable set of error message.

Hi! Thanks for replying. In this part are the errors, I hope it helps.

  • installing source package 'bslib' ...
    ** package 'bslib' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'htmltools' 0.5.2 is being loaded, but >= 0.5.4 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'bslib'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/bslib'
    Warning in install.packages :
    installation of package ‘bslib’ had non-zero exit status
  • installing source package 'lifecycle' ...
    ** package 'lifecycle' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.6 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'lifecycle'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/lifecycle'
    Warning in install.packages :
    installation of package ‘lifecycle’ had non-zero exit status
  • installing source package 'callr' ...
    ** package 'callr' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    namespace 'processx' 3.5.3 is being loaded, but >= 3.6.1 is required
    Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'callr'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/callr'
    Warning in install.packages :
    installation of package ‘callr’ had non-zero exit status
  • installing source package 'knitr' ...
    ** package 'knitr' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** demo
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    namespace 'xfun' 0.30 is being loaded, but >= 0.39 is required
    Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'knitr'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/knitr'
    Warning in install.packages :
    installation of package ‘knitr’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'tidyselect'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/tidyselect'
    Warning in install.packages :
    installation of package ‘tidyselect’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'gtable'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/gtable'
    Warning in install.packages :
    installation of package ‘gtable’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'scales'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/scales'
    Warning in install.packages :
    installation of package ‘scales’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'gargle'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/gargle'
    Warning in install.packages :
    installation of package ‘gargle’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'forcats'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/forcats'
    Warning in install.packages :
    installation of package ‘forcats’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'hms'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/hms'
    Warning in install.packages :
    installation of package ‘hms’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'pillar'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/pillar'
    Warning in install.packages :
    installation of package ‘pillar’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'rvest'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/rvest'
    Warning in install.packages :
    installation of package ‘rvest’ had non-zero exit status
    ERROR: dependency 'lifecycle' is not available for package 'stringr'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/stringr'
    Warning in install.packages :
    installation of package ‘stringr’ had non-zero exit status
    ERROR: dependencies 'bslib', 'knitr', 'stringr' are not available for package 'rmarkdown'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/rmarkdown'
    Warning in install.packages :
    installation of package ‘rmarkdown’ had non-zero exit status
    ERROR: dependencies 'lifecycle', 'stringr' are not available for package 'broom'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/broom'
    Warning in install.packages :
    installation of package ‘broom’ had non-zero exit status
    ERROR: dependencies 'lifecycle', 'pillar', 'tidyselect' are not available for package 'dbplyr'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/dbplyr'
    Warning in install.packages :
    installation of package ‘dbplyr’ had non-zero exit status
    ERROR: dependencies 'lifecycle', 'tidyselect' are not available for package 'dtplyr'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/dtplyr'
    Warning in install.packages :
    installation of package ‘dtplyr’ had non-zero exit status
    ERROR: dependencies 'gtable', 'lifecycle', 'scales' are not available for package 'ggplot2'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/ggplot2'
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status
    ERROR: dependencies 'gargle', 'lifecycle', 'pillar' are not available for package 'googledrive'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/googledrive'
    Warning in install.packages :
    installation of package ‘googledrive’ had non-zero exit status
    ERROR: dependencies 'gargle', 'googledrive', 'lifecycle' are not available for package 'googlesheets4'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/googlesheets4'
    Warning in install.packages :
    installation of package ‘googlesheets4’ had non-zero exit status
    ERROR: dependencies 'broom', 'tidyselect' are not available for package 'modelr'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/modelr'
    Warning in install.packages :
    installation of package ‘modelr’ had non-zero exit status
    ERROR: dependencies 'callr', 'knitr', 'lifecycle', 'rmarkdown' are not available for package 'reprex'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/reprex'
    Warning in install.packages :
    installation of package ‘reprex’ had non-zero exit status
    ERROR: dependencies 'broom', 'dbplyr', 'dtplyr', 'forcats', 'ggplot2', 'googledrive', 'googlesheets4', 'hms', 'modelr', 'pillar', 'reprex', 'rvest', 'stringr' are not available for package 'tidyverse'
  • removing 'C:/Users/asoph/OneDrive/Documenten/R/win-library/4.0/tidyverse'
    Warning in install.packages :
    installation of package ‘tidyverse’ had non-zero exit status

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

I already solved it! I just needed a different verison of Rtools in the end.

1 Like

Whilst R4.0.0 may certainly be new to you, it is itself already more than 3 years old. If you are taking time to go through some pain to modernise your R experience, would it not be wise to adopt the most recent version of R ?

Yes that is probably better. I just wanted to make sure that I could install the package that I need (Platypus). But I am also having some trouble with that now. I just need to figure out if I can install the newer version of R without losing all those packages that I already installed now.

I used installr now to get the newer version, let's hope it works.

Okay I did it but it does not open that newer version in Rstudio for some reason

Any error messages?

Is R opening okay on its own?

Yes, I got the new version now (4.3.1). However, I still cannot install the package that I need. I now that it should work for this version, because my colleague is also using it. I am getting this error:

BiocManager::install("Platypus")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package =
"BiocManager")' for details.
Replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.17 (BiocManager 1.30.21), R 4.3.1 (2023-06-16 ucrt)
Installing package(s) 'Platypus'
Warning message:
package ‘Platypus’ is not available for Bioconductor version '3.17'

A version of this package for your version of R might be available elsewhere,
see the ideas at

I am not likely to be of much help as I have not used Windows in 10 or 15 years and I am not a Bioconductor user but I'd suggest having a look at the author's Git page and seeing if there may be a way to install from there.

I solved it in the end, thanks for all the help!

Could you tell us what you did for other R users who may have a similar problem? Thanks.

Yes ofcourse, I am not exactly sure what solved it in the end though. My guess is that the packages were only saved in the system library, and if there comes a lock on it somewhere you can not alter that then. I found somewhere that you can prevent the locks by adding this: BiocManager::install("jsonlite", force = TRUE, INSTALL_opts = '--no-lock'). But I already had the lock on there so that did not really help for me. So what I did is make sure that the packages were downloaded in the user library instead of the system library, by first making a directory and then doing this: .libPaths(c("C:/Users/asoph/OneDrive/Documenten/R/win-library/4.3.1")). And after that it seemed to work much better. And then for installing Platypus I downloaded the tar.gz file from the github and then using this command: install.packages("Platypus", lib = "C:/Users/asoph/OneDrive/Documenten/R/win-library/4.3.1", dependencies = TRUE), but honestly I am not sure if the lib parameter works because it seemed to also put it in the user library without that parameter. I hope this helps if anyone has the same struggle. I think that in most cases if you download the newer R version is makes this user library itself, because my colleague did not seem to have this problem.

1 Like

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.