Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding - r

I need to install the “lifecycle” package in order to run an R code but I’m getting the error below.
I’ve already uninstalled and re-installed both RTools and R for Windows with no luck.
The WARNING message states to install the appropriate version of Rtools before proceeding – how do I find out what the ‘appropriate’ version that I would need to install?
>install.packages("lifecycle")
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:/RLibrary’
(as ‘lib’ is unspecified)
also installing the dependency ‘cli’
There are binary versions available but the source versions
are later:
binary source needs_compilation
cli 2.5.0 3.4.1 TRUE
lifecycle 1.0.0 1.0.3 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/cli_2.5.0.zip'
Content type 'application/zip' length 534931 bytes (522 KB)
downloaded 522 KB
package ‘cli’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\X\AppData\Local\Temp\RtmpM95qM9\downloaded_packages
installing the source package ‘lifecycle’
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
* 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 inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'c:/RLibrary/rlang/libs/x64/rlang.dll':
LoadLibrary failure: The specified procedure could not be found.
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load -> inDL
Execution halted
ERROR: lazy loading failed for package 'lifecycle'
* removing 'c:/RLibrary/lifecycle'
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status

Related

I cannot install "photosynthesis" package

For some reason, I dont seem to be able to install the package.
I tried to install it today but I get a couple of errors including the final "Warning in install.packages :
installation of package ‘photosynthesis’ had non-zero exit status"
I have installed other packages and that one is the only one that seems to have a problem.
Some colleagues have been able to install it so I do not know what I am doing wrong
Some help would be really appreciated it
Edit: Full error message
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:/rlibs/4.0.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘cli’, ‘lifecycle’, ‘rlang’, ‘vctrs’, ‘ggplot2’
There are binary versions available but the source versions are later:
binary source needs_compilation
cli 3.2.0 3.6.0 TRUE
lifecycle 1.0.1 1.0.3 FALSE
rlang 1.0.2 1.0.6 TRUE
vctrs 0.4.1 0.5.2 TRUE
ggplot2 3.3.5 3.4.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
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/vctrs_0.4.1.zip'
Content type 'application/zip' length 1569486 bytes (1.5 MB)
downloaded 1.5 MB
package ‘cli’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘vctrs’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\quesadaa\AppData\Local\Temp\RtmpMBWG1b\downloaded_packages
installing the source packages ‘lifecycle’, ‘ggplot2’, ‘photosynthesis’
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/ggplot2_3.4.0.tar.gz'
Content type 'application/x-gzip' length 3148426 bytes (3.0 MB)
downloaded 3.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/photosynthesis_2.1.1.tar.gz'
Content type 'application/x-gzip' length 2678855 bytes (2.6 MB)
downloaded 2.6 MB
'\\ad.helsinki.fi\home\q\quesadaa\Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* 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:/rlibs/4.0.5/lifecycle'
* restoring previous 'C:/rlibs/4.0.5/lifecycle'
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
'\\ad.helsinki.fi\home\q\quesadaa\Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'ggplot2' ...
** package 'ggplot2' 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(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'vctrs' 0.4.1 is being loaded, but >= 0.5.0 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/rlibs/4.0.5/ggplot2'
* restoring previous 'C:/rlibs/4.0.5/ggplot2'
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
'\\ad.helsinki.fi\home\q\quesadaa\Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'photosynthesis' ...
** package 'photosynthesis' successfully unpacked and MD5 sums checked
** using staged installation
** R
Error in parse(outFile) :
C:/Users/quesadaa/AppData/Local/Temp/Rtmp4UkMHR/R.INSTALL31846c817b0d/photosynthesis/R/bake-par.R:22:12: unexpected '>'
21: # Set units ----
22: .x = .x |>
^
ERROR: unable to collate and parse R files for package 'photosynthesis'
* removing 'C:/rlibs/4.0.5/photosynthesis'
Warning in install.packages :
installation of package ‘photosynthesis’ had non-zero exit status

Unable to install any package in computer at my office, how to fix?

I'm trying to use computer in my office for working using Rstudio because I realised that there is Rstudio installed in the computer. However, when I'm trying to install the package I need, the package is unable to install. I try so many package but the same issue happen.Even though, I'm trying to update installed package such as rlang version 1.02 to the latest one, it is also failed. I've tried to restart Rstudio as well after I installed the package, but I can't find the package that I have installed before.
Here is the error message that I receive when I try to install the very standard one such as scales package:
install.packages("scales")
also installing the dependencies ‘rlang’, ‘lifecycle’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 1.0.2 1.0.6 TRUE
lifecycle 1.0.1 1.0.2 FALSE
scales 1.2.0 1.2.1 FALSE
Binaries will be installed
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 ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\axk1076\AppData\Local\Temp\RtmpYjc7m3\downloaded_packages
installing the source packages ‘lifecycle’, ‘scales’
trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.2.tar.gz'
Content type 'application/x-gzip' length 102178 bytes (99 KB)
downloaded 99 KB
trying URL 'https://cran.rstudio.com/src/contrib/scales_1.2.1.tar.gz'
Content type 'application/x-gzip' length 270609 bytes (264 KB)
downloaded 264 KB
'\\adf\storage\A\K\AXK1076'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* 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.5 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'lifecycle'
* removing 'C:/Program Files/R/R-4.0.3/library/lifecycle'
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
'\\adf\storage\A\K\AXK1076'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
ERROR: dependency 'lifecycle' is not available for package 'scales'
* removing 'C:/Program Files/R/R-4.0.3/library/scales'
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\axk1076\AppData\Local\Temp\RtmpYjc7m3\downloaded_packages’
I don't know how Rstudio installed in this computer and I'm truly beginner in R. Is there anyone can help me? thank you in advance. Regards.
Since it is not known how R was installed in your computer, I would highly recommend you to uninstall both R and RStudio and installing the latest versions from the official websites.
First install R from: https://cran.r-project.org/bin/windows/base/
Install RStudio from: https://www.rstudio.com/products/rstudio/download/
Maybe they were installed in the wrong settings for your computer. Also to prevent bigger issues in the future (especially for beginners), that's the best option.

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

Not able to install RWeka

I am facing issues while installing the RWeka package. I tried installing rJava but even that is not being installed, can someone help here with the issue? You can follow the code for the error message
> install.packages("RWeka")
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/1911120/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
RWeka 0.4-42 0.4-43 FALSE
installing the source package ‘RWeka’
trying URL 'https://cran.rstudio.com/src/contrib/RWeka_0.4-43.tar.gz'
Content type 'application/x-gzip' length 451318 bytes (440 KB)
downloaded 440 KB
* installing *source* package 'RWeka' ...
** package 'RWeka' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** R
** inst
** byte-compile and prepare package for lazy loading
Error: .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Execution halted
ERROR: lazy loading failed for package 'RWeka'
* removing 'C:/Users/1911120/Documents/R/win-library/3.6/RWeka'
Warning in install.packages :
installation of package ‘RWeka’ had non-zero exit status

Resources