错误:“ treesnip”的包或名称空间加载失败

时间:2020-10-07 17:48:37

标签: r github

当尝试使用remotes :: install_github(“ curso-r / treesnip”)从github安装treesnip软件包时,出现以下错误:

remotes::install_github("curso-r/treesnip")
Downloading GitHub repo curso-r/treesnip@HEAD
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.
√  checking for file 'C:\Users\SAR.V-LOG\AppData\Local\Temp\RtmpENiM7Q\remotes38701dfb49f3\curso-r-treesnip-c70a89b/DESCRIPTION' (375ms)
-  preparing 'treesnip': (736ms)
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Removed empty directory 'treesnip/.github/workflows'
   Removed empty directory 'treesnip/.github'
     NB: this package now depends on R (>= 3.5.0)
     WARNING: Added dependency on R >= 3.5.0 because serialized objects in  serialize/load version 3 cannot be read in older versions of R.  File(s) containing such objects:  'treesnip/inst/benchmark_parallel_processing_vignette.rds'
-  building 'treesnip_0.1.0.tar.gz'
   
* installing *source* package 'treesnip' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'treesnip'
    finding HTML links ... done
    add_boost_tree_catboost                 html  
    add_boost_tree_lightgbm                 html  
    add_decision_tree_tree                  html  
    multi_predict._catboost.Model           html  
    multi_predict._lgb.Booster              html  
    predict_lightgbm_classification_class   html  
    predict_lightgbm_classification_prob    html  
    predict_lightgbm_classification_raw     html  
    predict_lightgbm_regression_numeric     html  
    train_catboost                          html  
    train_lightgbm                          html  
    train_tree                              html  
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'treesnip':
 .onLoad failed in loadNamespace() for 'treesnip', details:
  call: NULL
  error: The values passed to `set_encoding()` are missing arguments: 'allow_sparse_x'
error: loading failed
running stopped
*** arch - x64
Error: package or namespace load failed for 'treesnip':
 .onLoad failed in loadNamespace() for 'treesnip', details:
  call: NULL
  error: The values passed to `set_encoding()` are missing arguments: 'allow_sparse_x'
Fejl: loading failed
running stopped
ERROR: loading failed for 'i386', 'x64'
* removing 'C:/Users/SAR.V-LOG/OneDrive - VELUX/Documents 1/R/R-4.0.2/library/treesnip'
Error: Failed to install 'treesnip' from GitHub:
  (converted from warning) installation of package ‘C:/Users/SAR~1.V-L/AppData/Local/Temp/RtmpENiM7Q/file38706c2c7239/treesnip_0.1.0.tar.gz’ had non-zero exit status

我的sessionInfo():

sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=Danish_Denmark.1252  LC_CTYPE=Danish_Denmark.1252    LC_MONETARY=Danish_Denmark.1252
[4] LC_NUMERIC=C                    LC_TIME=Danish_Denmark.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2   

在另一台PC上运行时,我可以正常工作。 我还尝试将库位置更改为C:/Users/SAR.V-LOG/,但这也无济于事。 此外,我尝试提供INSTALL_opts =“ --no-test-load”。当我这样做时,安装完成了所有错误,但是当我尝试使用library(treesnip)加载库时,我得到了相同的错误:传递给set_encoding()的值缺少参数:'allow_sparse_x'

您知道导致此错误的原因以及如何解决该问题吗?

2 个答案:

答案 0 :(得分:1)

treesnip是固定的。现在,它取决于防风草(> = 0.1.3.9000)https://github.com/curso-r/treesnip/commit/902a33d9f156c10da6dbe1bd9cccb65926077197

答案 1 :(得分:0)

尝试使用欧洲防风草0.1.3(在这种情况下,不是开发版本)。似乎0.1.3.9000有一些重大更改,这些更改将在新版本的防风草相邻软件包中处理。


警告消息指示:

Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.

您可能需要升级Rtools,可以在此处完成:https://cran.r-project.org/bin/windows/Rtools/

让我知道这是否可以解决您的问题。


我还在这里添加了一个GitHub Issue:https://github.com/tidymodels/parsnip/issues/376