在AML中安装和加载tidymodels软件包
我正在尝试在Azure Machine Learning中的执行R脚本中安装并加载一些R软件包以运行模型,例如 tidymodels,timetk,modeltime,modeltime.semble.semble 。
library(forecast)
library(tidyverse)
library(lubridate)
install.packages("quantdates",repos = "https://cloud.r-project.org")
install.packages("tidymodels",repos = "https://cloud.r-project.org")
library(quantdates)
library(tidymodels)
library(timetk)
library(modeltime)
library(modeltime.resample)
library(modeltime.ensemble)
但是,我会收到以下错误:
Error: package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.5 is already loaded, but >= 1.0.2 is required
azureml_main(input_dataframe_1), library(tidymodels), tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, conditionMessage(e))
if (logical.return)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
}), tryCatchList(expr, classes, parentenv, handlers), tryCatchOne(expr, names, parentenv, handlers[[1]]), value[[3]](cond), stop(msg, call. = FALSE, domain = NA), .handleSimpleError(function (e)
{
error_msg <<- paste(toString(e), toString(sys.calls()[-c(1:3)]), sep = "\n")
stop(e)
}, "package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):\n namespace ‘rlang’ 0.4.5 is already loaded, but >= 1.0.2 is required", quote(NULL)), h(simpleError(msg, call))
'.
---------- End of error message from R interpreter ----------
我还尝试使用DevTools软件包来安装特定版本,但是我在 rlang软件包方面一直遇到相同的错误。有时, CLI软件包都会遇到相同的错误。
在我的本地计算机中,R代码运行正常。我有R版本4.1.3,Azure机器学习具有R版本3.5.1。
有人知道我如何解决这个问题吗?
I'm trying install and load some R packages in the Execute R Script in Azure Machine Learning for to run models, such as tidymodels, timetk, modeltime, modeltime.ensemble.
library(forecast)
library(tidyverse)
library(lubridate)
install.packages("quantdates",repos = "https://cloud.r-project.org")
install.packages("tidymodels",repos = "https://cloud.r-project.org")
library(quantdates)
library(tidymodels)
library(timetk)
library(modeltime)
library(modeltime.resample)
library(modeltime.ensemble)
However I get the following error:
Error: package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.5 is already loaded, but >= 1.0.2 is required
azureml_main(input_dataframe_1), library(tidymodels), tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, conditionMessage(e))
if (logical.return)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
}), tryCatchList(expr, classes, parentenv, handlers), tryCatchOne(expr, names, parentenv, handlers[[1]]), value[[3]](cond), stop(msg, call. = FALSE, domain = NA), .handleSimpleError(function (e)
{
error_msg <<- paste(toString(e), toString(sys.calls()[-c(1:3)]), sep = "\n")
stop(e)
}, "package or namespace load failed for ‘tidymodels’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):\n namespace ‘rlang’ 0.4.5 is already loaded, but >= 1.0.2 is required", quote(NULL)), h(simpleError(msg, call))
'.
---------- End of error message from R interpreter ----------
I have also tried with devtools package for install a particular version but I keep getting the same error with the rlang package. Sometimes, I get the same error with the cli package.
In my local machine, the R code runs fine. I have the R version 4.1.3 and the Azure Machine Learning has the R version 3.5.1.
Does anyone know how I can solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误消息说该版本问题已提出。
原因:当我们尝试将笔记本附加到群集上时,R名称空间将不会刷新。如果有新软件包版本的依赖性,则将通过 cran 下载较新的软件包,但不会加载。
解决方案:实现此目的的最佳方法是 群集安装的库
检查 链接 ,以更好地实现包装安装。
The error message says that version issue was raised.
Cause: When we try to attach the notebook to the cluster, R namespace will not be refreshed. When there is a dependency of new package versions, the newer packages will be downloaded through CRAN but not loaded.
Solution: The best way to achieve this is to install packages as Cluster-Installed libraries
Check the link for better implementation of package installation.