[英]Error: package or namespace load failed for 'treesnip'
嘗試使用 remotes::install_github("curso-r/treesnip") 從 github 安裝 treenip 軟件包時,出現以下錯誤:
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()
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'
你知道是什么導致了這個錯誤,我該如何解決?
treenip 是固定的。 現在取決於歐洲防風草 (>= 0.1.3.9000) https://github.com/curso-r/treesnip/commit/902a33d9f156c10da6dbe1bd9cccb65926077197
嘗試使用歐洲防風草 0.1.3(在這種情況下不是開發版本)。 看起來 0.1.3.9000 即將發生一些重大更改,這些更改將在新版本的 parsnip-adjacent 軟件包中處理。
警告消息指出:
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 問題: https : //github.com/tidymodels/parsnip/issues/376
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.