Installing package devtools I obtained the following message
There are binary versions available but the source versions are later:
binary source needs_compilation
processx 3.3.1 3.4.0 TRUE
callr 3.2.0 3.3.0 FALSE
Moreover:
* 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.3.1 is being loaded, but >= 3.4.0 is required
and
ERROR: lazy loading failed for package 'callr'
* removing 'C:/Users/Standard/Documents/R/win-library/3.6/callr'
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
Then I tried to update processx package, hoping that it could fix the problem:
install.packages("processx")
library(processx)
RStudio asked me to restart R session but then
> install.packages("devtools")
ERROR: lazy loading failed for package 'callr'
* removing 'C:/Users/Standard/Documents/R/win-library/3.6/callr'
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
What am I doing wrong?
EDIT I tried with installing processx and callr with their dependencies in this way
install.packages("processx", dependencies=TRUE)
library(processx)
install.packages("callr", dependencies=TRUE)
library(callr)
but I obtained the message:
Error in library(callr) : there is no package called ‘callr’
I had same problem. I think your problem is, that latest Rtools version needs to be installed. Devtools will install properly including dependencies to callr and processx after Rtools is installed. So do the following:
Delete the callr and processx and devtools packages from your library folder under your Rversion folder.
Close Rstudio or R shell.
Download recommended version from this site:
https://cran.r-project.org/bin/windows/Rtools/
Follow instructions here: http://jtleek.com/modules/01_DataScientistToolbox/02_10_rtools/#6
After rtools and then devtools are installed, check with find_rtools() if TRUE
Now callr and processx should be installed also as you can see in your library folder.
Related
I upgraded RStudio version to 3.6.3 and have endless issues installing the packages. I have never experienced that before and I am not an expert, so it has been a huge struggle. I posted a question on StackOverflow (Trouble installing package ‘export’ after upgrading R version. Is there an alternative to this package?) with several updates in the comments... The issues are always similar: it seems that the package is being loaded, but then it is not available.
For example:
** package 'dbplyr' 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' 0.4.11 is being loaded, but >= 1.0.0 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'dbplyr'
* removing 'C:/Users/...../Documents/R/win-library/3.6/dbplyr'
Warning in install.packages :
installation of package ‘dbplyr’ had non-zero exit status
> install.packages('Rtools ')
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/..../Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘Rtools ’ is not available (for R version 3.6.3)
I am having trouble downloading certain packages on my new work computer (Windows with R version 3.6.3). When I try downloading packages that have needs_compilation=FALSE,
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.4.11 1.0.3 TRUE
scales 1.1.1 1.2.0 FALSE
ggplot2 3.3.3 3.3.6 FALSE
I get the following error messages:
....
installing source package 'scales' ...
** package 'scales' successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'rlang' 0.4.11 is being loaded, but >= 1.0.0 is required
Kald: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Loading stopped
ERROR: lazy loading failed for package 'scales'
removing 'C:/Users/lesor/Documents/R/win-library/3.6/scales'
ERROR: dependency 'scales' is not available for package 'ggplot2'
removing 'C:/Users/lesor/Documents/R/win-library/3.6/ggplot2'
I am able to download packages like dplyr (which have need_compilation=TRUE), however these error messages show up for packages like knitr, rmarkdown, ggplot2 (which have need_compilation=FALSE). I have tried updating packages in global options, uninstalling and reinstalling R, installing packages in R instead of Rstudio, but nothing has worked so far. Would greatly appreciate any help.
Goal
I would like to install devtools to my version of R version 3.5.1.
Problem
When I install the package devtools, I get the following error:
here are binary versions available but the source versions are later:
binary source needs_compilation
processx 3.4.2 3.4.5 TRUE
callr 3.4.3 3.5.1 FALSE
covr 3.5.0 3.5.1 TRUE
ellipsis 0.3.0 0.3.1 TRUE
jsonlite 1.6.1 1.7.2 TRUE
pkgbuild 1.0.6 1.2.0 FALSE
pkgload 1.0.2 1.1.0 TRUE
rlang 0.4.5 0.4.10 TRUE
roxygen2 7.1.0 7.1.1 TRUE
devtools 2.3.0 2.3.2 FALSE
....
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'processx' 3.4.2 is being loaded, but >= 3.4.4 is required
ERROR: lazy loading failed for package 'callr'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/callr'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
ERROR: dependency 'callr' is not available for package 'pkgbuild'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/pkgbuild'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘pkgbuild’ had non-zero exit status
ERROR: dependencies 'callr', 'pkgbuild' are not available for package 'devtools'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/devtools'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
Attempted Solution
I tried to install processx 3.4.2 directly by downloading the package into my library from https://github.com/r-lib/processx/releases/tag/v3.4.2.
install.packages(paste0(folder, "processx-3.4.2.tar.gz"), repos = NULL)
Yet, I got the following error message:
Warning in untar2(tarfile, files, list, exdir, restore_times) :
failed to copy 'processx-3.4.2/inst/CODE_OF_CONDUCT.md' to 'processx-3.4.2/CODE_OF_CONDUCT.md'
Warning in untar2(tarfile, files, list, exdir, restore_times) :
skipping pax global extended headers
* installing *source* package 'processx' ...
** libs
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'processx'
* removing 'C:/Users/User/AppData/Local/R/win-library/3.5/processx'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/User/AppData/Local/R/win-library/3.5/processx-3.4.2.tar.gz’ had non-zero exit status
Your simplest fix is to either:
Install a newer version of R (!!recommended!!)
Use a snapshot mirror such as the ones from provided by microsoft at https://mran.microsoft.com/snapshots/{date} (replacing {date}) as the mirror argument in install.packages. By looking at https://cran.r-project.org/bin/windows/base/old/ we can see that R-3.5.1 was replaced by R-3.5.2 in december 2018. So I would suggest using 2018-11-31 as your snapshot mirror.
install.packages('devtools', mirror = 'https://mran.microsoft.com/snapshots/2018-11-31')
Some installed packages might "screw up the installation" (too recent versions?) so if the installation or some code fails after installation, I would suggest using renv and R projects (in Rstudio). This would ensure all packages are installed in a fresh environment and that there should be no version conflict (as they will all be installed from the specific snapshot). Reading introduction guides for renv and the Rstudio support for projects can help with this (in case you observe further problems).
It might also be sufficient to uninstall the packages (but it might break some other dependencies).
I'm trying to install the package "circlize" and I am having trouble resolving what seems to be a simple error.
When I run:
install.packages("circlize")
It says:
Installing package into ‘*file location*/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘GlobalOptions’ is not available
There is a binary version available but the source version is later:
binary source needs_compilation
circlize 0.3.10 0.4.3 FALSE
installing the source package ‘circlize’
trying URL 'https://mirrors.sorengard.com/cran/src/contrib/circlize_0.4.3.tar.gz'
Content type 'application/x-gzip' length 2456906 bytes (2.3 MB)
downloaded 2.3 MB
* installing *source* package 'circlize' ...
** package 'circlize' successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
ERROR: lazy loading failed for package 'circlize'
* removing '*file location*/3.2/circlize'
Warning in install.packages :
running command '"*file location*/x64/R" CMD INSTALL -l "*file location*\3.2" *file location*/downloaded_packages/circlize_0.4.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘circlize’ had non-zero exit status
The downloaded source packages are in
‘*file location*\downloaded_packages’
These parts seem most relevant to me:
dependency ‘GlobalOptions’ is not available
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
When I run sessionInfo() I see under "other attached packages": [1] GlobalOptions_0.0.11
My best guess is that I have the wrong version of GlobalOptions -- I see that GlobalOptions v0.0.13 is available here, but being new to R, I'm not sure what to do now to get the right version up and running.
I'd really appreciate if someone could tell me where I should look next. (I looked through the documentation within that link, but I'm still lost about what to do now.) Thanks!
If you have R version >=3.3.0 you should
install GlobalOptions_0.0.13 from CRAN
install.packages("GlobalOptions")
quit and restart R
re-install circlize from source as before.
If you have an older R version, update R to a more recent version first.
> require("caret")
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘pbkrtest’
So I found that there is lack of "pbkrtest" then I tried to reinstall it.
> install.packages("pbkrtest")
Installing package into ‘C:/Users/ADMIN/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is
later:
binary source needs_compilation
pbkrtest 0.4-2 0.4-3 FALSE
installing the source package ‘pbkrtest’
trying URL 'https://rweb.crmda.ku.edu/cran/src/contrib/pbkrtest_0.4- 3.tar.gz'
Content type 'application/x-gzip' length 164415 bytes (160 KB)
downloaded 160 KB
* installing *source* package 'pbkrtest' ...
** package 'pbkrtest' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by 'stats::sigma' when loading 'pbkrtest'
Error : object 'sigma' is not exported by 'namespace:stats'
ERROR: lazy loading failed for package 'pbkrtest'
* removing 'C:/Users/ADMIN/Documents/R/win-library/3.2/pbkrtest'
The downloaded source packages are in
‘C:\Users\ADMIN\AppData\Local\Temp\Rtmpk7mJT0\downloaded_packages’
Warning messages:
1: running command '"D:/R-3.2.3/bin/x64/R" CMD INSTALL -l
"C:\Users\ADMIN\Documents\R\win-library\3.2"
C:\Users\ADMIN\AppData\Local\Temp\Rtmpk7mJT0/downloaded_packages/pbkrtest_0.4- 3.tar.gz' had status 1
2: In install.packages("pbkrtest") :
installation of package ‘pbkrtest’ had non-zero exit status
It seems like that the installation keeps failing.
As a result, I couldn't use other code using caret packages.
I faced this problem as well on Windows 7. I did following steps in the sequence and it worked.
a) Make sure your R version is updated latest R release 3.2.3
b) The default sources seems to be installing Unix version. So I manually downloaded https://cran.r-project.org/web/packages/pbkrtest/index.html for windows
c) Use manually install function from R menu to install the package.
Cheers,
Ratan
Check version of R by typing version in your console.
If version is not "version.string R version 3.3.2" or later then
Install new version of R from https://cran.r-project.org/bin/windows/base/
Update R version using Tools => Global Options in RStudio.
install package using "install.packages("caret")" in your console.
do require(caret).
test using ?createDataPartition.