Failure to install tidyverse package in R: "namespace 'tidyselect' 1.1.0 is being loaded, but >= 1.1.1 is required" - r

I'm trying to install "tidyverse" package in R using install.packages("tidyverse"), but it returns the following error:
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/franc/OneDrive/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
tidyverse 1.3.1 1.3.2 FALSE
installing the source package ‘tidyverse’
tentando a URL 'https://cran.rstudio.com/src/contrib/tidyverse_1.3.2.tar.gz'
Content type 'application/x-gzip' length 702514 bytes (686 KB)
downloaded 686 KB
* installing *source* package 'tidyverse' ...
** package 'tidyverse' 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 'tidyselect' 1.1.0 is being loaded, but >= 1.1.1 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execução interrompida
ERROR: lazy loading failed for package 'tidyverse'
* removing 'C:/Users/franc/OneDrive/Documents/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\franc\AppData\Local\Temp\RtmpiqAHM6\downloaded_packages’
For some reason the installation doesn't work. I've also tried using install.packages('tidyverse', type = 'binary'), but it installs an older version that is incompatible with some packages I have to use.

Related

Can't install packages in R

[Asking for a colleague because his post is considered as a spam by the website bot.]
I am trying to install the package stringr on R.
I ran install.packages("stringr") in RStudio and it raised an error. Then, I try installing it from the terminal and it raised a similar error, see below. Any package I try to install raises the same issue.
I have Windows 10 but I do not have admin rights. I have R version 4.0.5. I installed R and RStudio via Anaconda. By the way, it seems that there is an issue with Rtools. The content of .Renviron is PATH="${RTOOLS42_HOME}\usr\bin;${PATH}" (as it should be I guess) but Sys.which("make") returns "" in Rstudio. One last thing, my R home environment is on my OneDrive folder, maybe this causes the issue?
Any idea?
C:\Users\TDOUENN>Rscript -e "install.packages('stringr', repos='https://cran.rstudio.com/')"
Installing package into 'C:/Users/TDOUENN/OneDrive - UvA/Documents/My_RLibs'
(as 'lib' is unspecified)
also installing the dependencies 'cli', 'rlang', 'lifecycle'
There are binary versions available but the source versions are later:
binary source needs_compilation
cli 3.2.0 3.6.0 TRUE
rlang 1.0.2 1.0.6 TRUE
lifecycle 1.0.1 1.0.3 FALSE
stringr 1.4.0 1.5.0 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/cli_3.2.0.zip'
Content type 'application/zip' length 1255499 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_1.0.2.zip'
Content type 'application/zip' length 1718546 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
package 'cli' successfully unpacked and MD5 sums checked
package 'rlang' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\TDOUENN\AppData\Local\Temp\RtmpkPFcWJ\downloaded_packages
installing the source packages 'lifecycle', 'stringr'
trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.3.tar.gz'
Content type 'application/x-gzip' length 106854 bytes (104 KB)
==================================================
downloaded 104 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringr_1.5.0.tar.gz'
Content type 'application/x-gzip' length 175699 bytes (171 KB)
==================================================
downloaded 171 KB
* 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: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'lifecycle'
* removing 'C:/Users/TDOUENN/OneDrive - UvA/Documents/My_RLibs/lifecycle'
* installing *source* package 'stringr' ...
** package 'stringr' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'lifecycle' 1.0.0 is being loaded, but >= 1.0.3 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'stringr'
* removing 'C:/Users/TDOUENN/OneDrive - UvA/Documents/My_RLibs/stringr'
The downloaded source packages are in
'C:\Users\TDOUENN\AppData\Local\Temp\RtmpkPFcWJ\downloaded_packages'
Warning messages:
1: In install.packages("stringr", repos = "https://cran.rstudio.com/") :
installation of package 'lifecycle' had non-zero exit status
2: In install.packages("stringr", repos = "https://cran.rstudio.com/") :
installation of package 'stringr' had non-zero exit status
C:\Users\TDOUENN>Rscript -e "install.packages('stringr', repos='https://cran.rstudio.com/')"
Based on these lines from the error message:
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
And this error:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'lifecycle' 1.0.0 is being loaded, but >= 1.0.3 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
It looks like your colleague needs to update their lifecycle and rlang packages in order to install stringr.

Problem with installation of devtools package

this is the warning massage I get.
If anyone has an idea If anyone has an idea how to help me, I would greatly appreciate it.
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/
There is a binary version available but the source version is later:
binary source needs_compilation devtools 2.4.4 2.4.5 FALSE
installing the source package ‘devtools’
trying URL
'https://cran.rstudio.com/src/contrib/devtools_2.4.5.tar.gz' Content
type 'application/x-gzip' length 374718 bytes (365 KB) downloaded 365
KB
* installing *source* package 'devtools' ...
** package 'devtools' 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: <Anonymous> ... namespaceImport -> loadNamespace ->
namespaceImport -> loadNamespace Execution halted ERROR: lazy loading
failed for package 'devtools'
* removing 'C:/Program Files/R/R-4.1.3/library/devtools' Warning in install.packages : installation of package ‘devtools’ had non-zero
exit status
I tried to install the package without success. I did not find a guide on the Internet that solved my problem

Devtools not installing, non-zero exit status

I'm very new to R and I've been trying to install CRAN "devtools" package in R, version 4.1.2 and keep getting the following error message (I am on a Windows 11 computer, 64-bit):
> install.packages("devtools")
Installing package into ‘C:/Users/court/OneDrive/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
installing the source package ‘devtools’
trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.4.5.tar.gz'
Content type 'application/x-gzip' length 374718 bytes (365 KB) downloaded 365 KB
* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked **
using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading
Warning message: package 'usethis' was built under R version 4.1.3
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: <Anonymous> ... namespaceImport -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'devtools' * removing 'C:/Users/court/OneDrive/Documents/R/win-library/4.1/devtools'
Warning in install.packages : installation of package ‘devtools’ had non-zero exit status The downloaded source packages are in ‘C:\Users\court\AppData\Local\Temp\RtmpSGwqVR\downloaded_packages’
Does anyone have any input about how to solve this issue?
Thanks in advance!
I installed the rtools package relevant to my computer but that didn't work. I also ran RStudio as an administrator and it didn't work either.

Cannot load plm package after installing it?

Hello, could someone help me with this? I install the plm package, however, when I try to load it R gives me an error:
library(plm)
Output:
Error in library(plm) : there is no package called ‘plm’"
About the installation of the package that is the output:
install.packages("plm")
Output:
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/be_al/OneDrive - UvA/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘collapse’
There are binary versions available but the source versions are later:
binary source needs_compilation
collapse 1.5.3 1.7.6 TRUE
plm 2.4-1 2.6-1 FALSE
Binaries will be installed
tentando a URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/collapse_1.5.3.zip'
Content type 'application/zip' length 3842937 bytes (3.7 MB)
downloaded 3.7 MB
package ‘collapse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\be_al\AppData\Local\Temp\Rtmp4gBL5q\downloaded_packages
installing the source package ‘plm’
tentando a URL 'https://cran.rstudio.com/src/contrib/plm_2.6-1.tar.gz'
Content type 'application/x-gzip' length 1652371 bytes (1.6 MB)
downloaded 1.6 MB
* installing *source* package 'plm' ...
** package 'plm' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'collapse' 1.5.3 is being loaded, but >= 1.6.0 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execução interrompida
ERROR: lazy loading failed for package 'plm'
* removing 'C:/Users/be_al/OneDrive - UvA/Documents/R/win-library/3.6/plm'
Warning in install.packages :
installation of package ‘plm’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\be_al\AppData\Local\Temp\Rtmp4gBL5q\downloaded_packages’
3. From previous posts here I tried:
install.packages("plm", dependencies = TRUE)
but it still didn't work for me. And I also tried installing and loading multiple times but always get the same error.
Try:
install.packages("plm",type="win.binary")
This must work

Errors lazy loading failed for package 'devtools'

im trying to install DEVTOOLS but i keep getting the error showing . can any one assist please. The 2 errors as showing below
error 1:package usethis was built under R version 4.0.5
Error in loadNamespace
error 2:ERROR: lazy loading failed for package devtools
Here is my code
install.packages("blockmodeling", dependencies = TRUE)
install.packages("devtools", dependencies = TRUE)
library(devtools)
devtools::install_github("aslez/concoR")
install.packages("blockmodeling", dependencies = TRUE)
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/eslam/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/blockmodeling_1.0.0.zip'
Content type 'application/zip' length 410411 bytes (400 KB)
downloaded 400 KB
package ‘blockmodeling’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\eslam\AppData\Local\Temp\Rtmp6nB24u\downloaded_packages
> install.packages("devtools", dependencies = TRUE)
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/eslam/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘pkgload’
There are binary versions available but the source versions are later:
binary source needs_compilation
pkgload 1.2.0 1.2.1 TRUE
devtools 2.3.2 2.4.0 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/pkgload_1.2.0.zip'
Content type 'application/zip' length 151933 bytes (148 KB)
downloaded 148 KB
package ‘pkgload’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\eslam\AppData\Local\Temp\Rtmp6nB24u\downloaded_packages
installing the source package ‘devtools’
trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.4.0.tar.gz'
Content type 'application/x-gzip' length 369987 bytes (361 KB)
downloaded 361 KB
* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Warning message:
package 'usethis' was built under R version 4.0.5
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'pkgload' 1.2.0 is being loaded, but >= 1.2.1 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
> ERROR
: lazy loading failed for package 'devtools'
* removing 'C:/Users/eslam/Documents/R/win-library/4.0/devtools'
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\eslam\AppData\Local\Temp\Rtmp6nB24u\downloaded_packages’
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
> devtools::install_github("aslez/concoR")
Error in loadNamespace(name) : there is no package called ‘devtools’
Thanks everyone for the support.
i figured it out . i had to run
install.packages("devtools,type="win.binary")

Resources