【问题标题】:R Windows: Error installing package 'rvest' (and several other packages)R Windows:安装包“rvest”(和其他几个包)时出错
【发布时间】:2019-08-19 23:32:19
【问题描述】:

我正在尝试在 Visual Studio 2017 的全新 R 安装中安装包。一些包会安装,但有几个包给我同样的错误。一个例子是“rvest”包。当我尝试 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

这也发生在“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

我的 sessionInfo() 显示:

> 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 

任何帮助追踪此问题的根源将不胜感激!

【问题讨论】:

  • 这是安装尝试的完整输出吗?通常还有比这更有用的信息。
  • 您在尝试安装这些软件包时是否打开了多个会话?关闭所有会话,打开一个新会话,然后尝试安装?这是我有时仍然犯的错误——这是一个 Windows 问题。
  • 这是每次安装尝试的完整输出。我同意我通常会看到比这更多的信息,t
  • .. 但这就是我在这些情况下得到的...
  • 对于多个会话,当我尝试安装这些软件包时,我只打开了一个 R 会话。

标签: r package


【解决方案1】:

我能够使用

加载这些包
type = "binary"

install.packages() 方法调用中的参数。即:

install.packages("rvest", type = "binary")

【讨论】:

    【解决方案2】:

    你可以尝试使用devtools安装github版本的包,如下:

    install.packages("devtools")
    devtools::install_github("tidyverse/rvest")
    

    【讨论】:

    • 我已经正确安装了 devtools。当我运行第二行时,我得到了
    • > devtools::install_github("tidyverse/rvest") 下载 GitHub 存储库 tidyverse/rvest@master (function (command = NULL, args = character(), error_on_status = TRUE, : 系统命令错误
    • 顺便说一句,为了从 github 下载,我需要使用 options(download.file.method = "wininet")
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-08
    • 2014-12-02
    • 2021-07-13
    相关资源
    最近更新 更多