I am trying to install packages in a fresh install of R in Visual Studio 2017. Some packages will install, but several give me the same error. An example is the 'rvest' package. When I try install.packages("rvest")
install.packages("rvest")
Installing package into ‘C:/Users/Sean/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rvest 0.3.2 0.3.3 FALSE
installing the source package ‘rvest’
trying URL 'https://mran.microsoft.com/snapshot/2019-04-15/src/contrib/rvest_0.3.3.tar.gz'
Content type 'application/octet-stream' length 1631059 bytes (1.6 MB)
downloaded 1.6 MB
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\Sean\AppData\Local\Temp\RtmpmuXBs1\downloaded_packages’
Warning message:
In utils::install.packages(...) :
installation of package ‘rvest’ had non-zero exit status
This happens also in 'rcmdcheck':
> install.packages("rcmdcheck")
Installing package into ‘C:/Users/Sean/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rcmdcheck 1.3.1 1.3.2 FALSE
installing the source package ‘rcmdcheck’
trying URL 'https://mran.microsoft.com/snapshot/2019-04-15/src/contrib/rcmdcheck_1.3.2.tar.gz'
Content type 'application/octet-stream' length 1408582 bytes (1.3 MB)
downloaded 1.3 MB
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\Sean\AppData\Local\Temp\RtmpmuXBs1\downloaded_packages’
Warning message:
In utils::install.packages(...) :
installation of package ‘rcmdcheck’ had non-zero exit status
My sessionInfo() shows:
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] FSVRegimeDetection_0.0.0.9000 aTSA_3.1.2 autoimage_2.0 FSVPreselection_0.0.0.9000 FSVTradingRules_0.0.0.9000 FinancialInstrument_1.3.1 quantmod_0.4-14
[8] FSVIndicators_0.0.0.9000 dlm_1.1-5 PerformanceAnalytics_1.5.2 TTR_0.23-4 FSVPositionSizing_0.0.0.9000 FSVDataCheck_0.0.0.9000 xts_0.11-2
[15] zoo_1.8-5 FSVLibraryUtilities_0.0.0.9000 roxygen2_6.1.1 usethis_1.5.0 devtools_2.0.2 ldhmm_0.4.5 RevoUtils_11.0.3
[22] RevoUtilsMath_11.0.0
loaded via a namespace (and not attached):
[1] ecd_0.9.1 pkgload_1.0.2 bit64_0.9-7 moments_0.14 assertthat_0.2.1 rtvs_1.0.0.0 RcppFaddeeva_0.1.0 blob_1.1.1 yaml_2.2.0 remotes_2.0.4
[11] sessioninfo_1.1.1 numDeriv_2016.8-1 pillar_1.3.1 RSQLite_2.1.1 backports_1.1.4 lattice_0.20-38 glue_1.3.1 quadprog_1.5-5 digest_0.6.18 colorspace_1.4-1
[21] plyr_1.8.4 pkgconfig_2.0.2 purrr_0.3.2 xtable_1.8-3 scales_1.0.0 processx_3.3.0 tibble_2.1.1 gmp_0.5-13.5 ggplot2_3.1.1 withr_2.1.2
[31] lazyeval_0.2.2 Rmpfr_0.7-2 cli_1.1.0 magrittr_1.5 crayon_1.3.4 memoise_1.1.0 ps_1.3.0 fs_1.2.7 gsl_2.1-6 xml2_1.2.0
[41] pkgbuild_1.0.3 tools_3.5.3 prettyunits_1.0.2 stringr_1.4.0 munsell_0.5.0 stabledist_0.7-1 FSVBackTest_0.0.0.9000 callr_3.2.0 compiler_3.5.3 rlang_0.3.4
[51] grid_3.5.3 rstudioapi_0.10 testthat_2.0.1 gtable_0.3.0 curl_3.3 DBI_1.0.0 polynom_1.4-0 R6_2.4.0 gridExtra_2.3 knitr_1.22
[61] dplyr_0.8.0.1 optimx_2018-7.10 bit_1.1-14 commonmark_1.7 rprojroot_1.3-2 desc_1.2.0 stringi_1.4.3 parallel_3.5.3 Rcpp_1.0.1 tidyselect_0.2.5
[71] xfun_0.6
Any help tracking down the source of this issue would be greatly appreciated!
I was able to get these packages to load using
type = "binary"
argument in the install.packages() method call. Ie:
install.packages("rvest", type = "binary")
You can try to install the github version of the package using devtools, as below:
install.packages("devtools")
devtools::install_github("tidyverse/rvest")
Related
I've successfully installed Lime (and glmnet) in R but when I try loading it i receive an error:
> require(lime)
Loading required package: lime
Error: package or namespace load failed for ‘lime’:
object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet'
Searched online and can't seem to find a solution for this.
This is my sessioninfo()
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] glmnet_3.0 Matrix_1.2-17
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 rstudioapi_0.10 magrittr_1.5 tidyselect_0.2.5 munsell_0.5.0 colorspace_1.4-1 lattice_0.20-38 R6_2.4.0 rlang_0.4.1
[10] foreach_1.4.7 dplyr_0.8.3 tools_3.6.1 grid_3.6.1 gtable_0.3.0 iterators_1.0.12 lazyeval_0.2.2 assertthat_0.2.1 tibble_2.1.3
[19] crayon_1.3.4 purrr_0.3.3 ggplot2_3.2.1 codetools_0.2-16 shape_1.4.4 glue_1.3.1 compiler_3.6.1 pillar_1.4.2 scales_1.0.0
[28] pkgconfig_2.0.3
I've updated all my packages.
glmnet loads successfully
> library(glmnet)
Loaded glmnet 3.0
The recent major update of glmnet (which now does not export coef.cv.glmnet anymore) appears to have broken lime. You can see errors with the same cause in the CRAN tests. You can expect a fix by the package maintainer soon (or the package will be archived by CRAN). See also this bug report and the answer by the maintainer:
This is due to a recent breaking change in glmnet—lime will be updated soon to fix this
Im building an R package and when testing the package using devtools::check() I get an error when the test reaches the installation phase, saying:
Error: .onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: there is no package called 'vctrs'
Execution halted
ERROR: lazy loading failed for package
Neither pillar nor vctrs are mentioned in my description file, so they must be dependents of some other package that I depend on. Both pillar and vctrs are installed and I've also tried reinstalling them. They are stored in the the first .libPath entry. I tried installing pillar from github as was suggested by mfox9 here, but this failed for me, giving this error:
> devtools::install_github("r-lib/pillar")
Downloading GitHub repo r-lib/pillar#master
√ checking for file 'C:\Users\DESCRIPTION' (337ms)
- preparing 'pillar': (664ms)
√ checking DESCRIPTION meta-information ...
- installing the package to process help pages
- checking for LF line-endings in source and make files and shell scripts (8.5s)
- checking for empty or unneeded directories
- building 'pillar_1.4.2.9001.tar.gz'
Installing package into ‘Z:/’
(as ‘lib’ is unspecified)
The filename, directory name, or volume label syntax is incorrect.
Error: Failed to install 'pillar' from GitHub:
(converted from warning) installation of package ‘C:/Users/Temp/RtmpgjFfZl/file32586b634e28/pillar_1.4.2.9001.tar.gz’ had non-zero exit status
(note: z:/ is my correct R library address)
Can someone please help?
´´´
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 15063)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] pillar_1.4.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 rstudioapi_0.10 magrittr_1.5 usethis_1.5.1
[5] devtools_2.2.0 pkgload_1.0.2 R6_2.4.0 rlang_0.4.0
[9] tools_3.6.1 pkgbuild_1.0.5 DT_0.8 packrat_0.5.0
[13] sessioninfo_1.1.1 cli_1.1.0 withr_2.1.2 remotes_2.1.0
[17] htmltools_0.3.6 ellipsis_0.2.0.1 assertthat_0.2.1 digest_0.6.20
[21] rprojroot_1.3-2 crayon_1.3.4 processx_3.4.1 callr_3.3.1
[25] fs_1.3.1 htmlwidgets_1.3 ps_1.3.0 curl_4.0
[29] testthat_2.2.1 glue_1.3.1 memoise_1.1.0 compiler_3.6.1
[33] desc_1.2.0 backports_1.1.4 prettyunits_1.0.2
´´´
When I run devtools::build_vignettes() I get:
> devtools::build_vignettes()
Building OwenQ vignettes
Your system is ready to build packages!
And then R is freezed. Nothing happens, even after 15 minutes. No folder doc or inst/doc is created.
EDIT
I also tried the following with R 3.6.1:
> devtools::install(build_vignettes = TRUE)
Then I get
Your system is ready to build packages!
√ checking for file 'C:\MyPackages\OwenQ/DESCRIPTION' ...
- preparing 'OwenQ': (8.4s)
√ checking DESCRIPTION meta-information ...
- cleaning src
- installing the package to build vignettes (543ms)
creating vignettes ...
And same result: nothing else happens.
EDIT
Finally, devtools::install(build_vignettes = TRUE) has correctly created the vignettes! But there's no folder inst/doc in the package source folder, the vignettes only are in the package installed folder.
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=French_Belgium.1252 LC_CTYPE=French_Belgium.1252
[3] LC_MONETARY=French_Belgium.1252 LC_NUMERIC=C
[5] LC_TIME=French_Belgium.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] OwenQ_1.0.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 rstudioapi_0.10 knitr_1.22 magrittr_1.5
[5] usethis_1.5.1 devtools_2.1.0 pkgload_1.0.2 R6_2.4.0
[9] rlang_0.4.0 tools_3.5.3 pkgbuild_1.0.4 xfun_0.7
[13] sessioninfo_1.1.1 cli_1.1.0 withr_2.1.2 remotes_2.1.0
[17] yaml_2.2.0 assertthat_0.2.1 digest_0.6.20 rprojroot_1.3-2
[21] crayon_1.3.4 processx_3.4.1 callr_3.3.1 fs_1.3.1
[25] ps_1.3.0 testthat_2.2.1 glue_1.3.1 memoise_1.1.0
[29] compiler_3.5.3 desc_1.2.0 backports_1.1.4 prettyunits_1.0.2
I am using R studio on Mac OS and I want to use caret package for some data analysis. However, caret depends on rlang package and when I try to load caret package I get this error -
> library(caret)
Error: package or namespace load failed for ‘caret’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.2.2 is already loaded, but >= 0.3.0.1 is required
In addition: Warning message:
package ‘caret’ was built under R version 3.4.4
I removed the rlang package from the UI and tried installing it again but I am facing below issue -
> install.packages("rlang")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rlang_0.3.0.1.tgz'
Content type 'application/x-gzip' length 1074663 bytes (1.0 MB)
==================================================
downloaded 1.0 MB
The downloaded binary packages are in
/var/folders/kh/9lkdq11x3sv56717v0700p_r_16f9p/T//RtmplrCvGX/downloaded_packages
> library(rlang)
Error in value[[3L]](cond) :
Package ‘rlang’ version 0.2.2 cannot be unloaded:
Error in unloadNamespace(package) : namespace ‘rlang’ is imported by ‘tidyr’, ‘purrr’, ‘ggplot2’, ‘plotly’, ‘dplyr’, ‘tibble’, ‘pillar’ so cannot be unloaded
In addition: Warning message:
package ‘rlang’ was built under R version 3.4.4
Here is my sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dummies_1.5.6 ISLR_1.2 mltools_0.3.5 data.table_1.10.4-3 ggplot2_3.0.0.9000 lattice_0.20-35
loaded via a namespace (and not attached):
[1] reshape2_1.4.3 purrr_0.2.4 colorspace_1.3-2 htmltools_0.3.6 viridisLite_0.3.0 yaml_2.1.16 plotly_4.8.0
[8] rlang_0.3.0.1 ModelMetrics_1.2.2 pillar_1.1.0 glue_1.2.0 withr_2.1.2 bindrcpp_0.2 foreach_1.4.4
[15] bindr_0.1 plyr_1.8.4 stringr_1.2.0 munsell_0.5.0 gtable_0.2.0 htmlwidgets_1.2 devtools_1.13.4
[22] codetools_0.2-15 memoise_1.1.0 curl_3.1 Rcpp_0.12.18 scales_1.0.0 jsonlite_1.5 digest_0.6.16
[29] stringi_1.1.6 dplyr_0.7.4 grid_3.4.3 tools_3.4.3 magrittr_1.5 lazyeval_0.2.1 tibble_1.4.2
[36] tidyr_0.7.2 pkgconfig_2.0.1 Matrix_1.2-12 assertthat_0.2.0 httr_1.3.1 iterators_1.0.10 R6_2.2.2
[43] nlme_3.1-131 compiler_3.4.3 git2r_0.21.0
Maybe try this -- Remove rlang, shutdown and restart R, and then reinstall `rlang'.
If you still want to install a specific version of rlang,
1) Go to https://cran.r-project.org/src/contrib/Archive/rlang/
2) Get URL to the specific version you need. (On Chrome, Right click- Copy URL, etc)
3) Start R, install.packages("[URL]", repo=NULL, type="source")
e.g install.packages("https://cran.r-project.org/src/contrib/Archive/rlang/rlang_0.2.2.tar.gz", repo=NULL, type="source")
My goal is to install tmap R package from CRAN. I have followed through this installation procedure prior to installing the tmap package:
https://github.com/mtennekes/tmap/blob/master/ubuntu_17_installation.sh
After install.packages("tmap") I receive an error message that identifies the problem to be with the rgdal package.
Calling install.packages("rgdal"), I received the following:
Beginning of Traceback error message:
installing to /home/larnsce/R/x86_64-pc-linux-gnu-library/3.4/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** caught segfault ***
address 0x1e, cause 'memory not mapped'
End of Traceback error message:
22: tools:::.test_load_package("rgdal", "/home/larnsce/R/x86_64-pc-linux-gnu-library/3.4")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
ERROR: loading failed
* removing ‘/home/larnsce/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
My sessionInfo():
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_CH.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=de_CH.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_CH.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 ggalt_0.4.0 mapdata_2.2-6 maps_3.2.0 sp_1.2-5 ggmap_2.6.1 dplyr_0.7.4
[8] purrr_0.2.3 readr_1.1.1 tidyr_0.7.1 tibble_1.3.4 ggplot2_2.2.1.9000 tidyverse_1.1.1
loaded via a namespace (and not attached):
[1] reshape2_1.4.2 haven_1.1.0 lattice_0.20-35 colorspace_1.3-2 yaml_2.1.14 rlang_0.1.2 foreign_0.8-69
[8] glue_1.1.1 RColorBrewer_1.1-2 modelr_0.1.1 readxl_1.0.0 jpeg_0.1-8 bindr_0.1 plyr_1.8.4
[15] stringr_1.2.0 munsell_0.4.3 gtable_0.2.0 cellranger_1.1.0 rvest_0.3.2 RgoogleMaps_1.4.1 mapproj_1.2-5
[22] psych_1.7.5 labeling_0.3 knitr_1.17 forcats_0.2.0 extrafont_0.17 parallel_3.4.2 Rttf2pt1_1.3.4
[29] broom_0.4.2 proto_1.0.0 Rcpp_0.12.13 KernSmooth_2.23-15 geosphere_1.5-5 scales_0.5.0.9000 jsonlite_1.5
[36] proj4_1.0-8 mnormt_1.5-5 digest_0.6.12 rjson_0.2.15 hms_0.3 png_0.1-7 stringi_1.1.5
[43] ash_1.0-15 grid_3.4.2 tools_3.4.2 magrittr_1.5 lazyeval_0.2.0 extrafontdb_1.0 pkgconfig_2.0.1
[50] MASS_7.3-47 xml2_1.1.1 lubridate_1.6.0 assertthat_0.2.0 httr_1.2.1 R6_2.2.2 nlme_3.1-131
[57] compiler_3.4.2
Installing rgdal from source gives the following different segfault message:
*** caught segfault ***
address 0x7fe075206833, cause 'invalid permissions'
This might be relevant:
./configure: line 2112: 21315 Aborted ./proj_conf_test2
checking PROJ.4: epsg found and readable... yes
./configure: line 2187: 21324 Aborted ./proj_conf_test3
checking PROJ.4: conus found and readable... yes
Other related questions I have explored
trouble in installing rgdal on ubuntu 16.04
rgdal installation difficulty on ubuntu 16.04 LTS
This is also posted as an issue on GitHub
https://github.com/mtennekes/tmap/issues/150