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.
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)
This question already has answers here:
R install package loaded namespace
(4 answers)
tidyverse not loaded, it says "namespace ‘vctrs’ 0.2.0 is already loaded, but >= 0.2.1 is required"
(5 answers)
Closed 10 months ago.
I am trying to install ggplot2 package in R and getting following error. kindly let me know what's wrong. I have reinstalled R also but nothing is working. Anyone please help. Thanks in advance.
> install.packages("ggplot2")
Installing package into ‘C:/Users/HP/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
ggplot2 3.3.5 3.3.6 FALSE
installing the source package ‘ggplot2’
trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.3.6.tar.gz'
Content type 'application/x-gzip' length 3061989 bytes (2.9 MB)
downloaded 2.9 MB
* 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 'rlang' 0.4.11 is already loaded, but >= 1.0.0 is required
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/HP/Documents/R/win-library/4.0/ggplot2'
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\HP\AppData\Local\Temp\Rtmpk7jY7e\downloaded_packages’
Whenever I try to install tidyverse in R v 3.6.2
I receive the following error message:
Installing package into ‘C:/Users/daeb/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘broom’
There is a binary version available but the source version is later:
binary source needs_compilation
broom 0.5.3 0.5.4 FALSE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440101 bytes (429 KB)
downloaded 429 KB
package ‘tidyverse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\daeb\AppData\Local\Temp\RtmpuWXq4I\downloaded_packages
installing the source package ‘broom’
trying URL 'https://cran.rstudio.com/src/contrib/broom_0.5.4.tar.gz'
Content type 'application/x-gzip' length 1228129 bytes (1.2 MB)
downloaded 1.2 MB
* installing *source* package 'broom' ...
** package 'broom' 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
Fejl i loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'zeallot'
Kald: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Kørsel stoppet
ERROR: lazy loading failed for package 'broom'
* removing 'C:/Users/daeb/Documents/R/win-library/3.6/broom'
Warning in install.packages :
installation of package ‘broom’ had non-zero exit status
I have tried reinstalling both R and Rstudio but it does not solve the problem. I tried installing Rtools, but it does not work either. It appears I have to solve the source/binary issue with broom but I do not know how.
As #hplieninger suggests, the proximal problem is that the installation of broom is looking for the zeallot package, which isn't installed:
there is no package called 'zeallot'
You should try manually installing the zeallot package (install.packages("zeallot")) and then try installing tidyverse again.
It might also help to say "no" when R asks you whether you want to install the packages with more recent source-code versions from source rather than binary. (The worst thing that can happen is that you end up with slightly older versions of some packages.)
However it's surprising that this requirement comes up. Are you using install.packages("tidyverse")? Are you specifying something like dependencies=TRUE?
Because according to the CRAN index pages
The current version of broom (0.5.4, apparently the same version that R is trying to install for you) doesn't directly import zeallot: it Depends only on R and
Imports: backports, dplyr, generics (≥ 0.0.2), methods, nlme, purrr, reshape2, stringr, tibble, tidyr
The current version of zeallot shouldn't obviously be needed. The packages that use it are:
Reverse imports: completejourney, graphTweets, ipumsr, keras, mlflow, statsExpressions
Reverse suggests: listarrays, SDMtune, vctrs
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.
> 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.