【发布时间】:2021-04-14 10:27:10
【问题描述】:
我正在尝试安装名为 devtools 的软件包。我运行命令:
install.packages("devtools") 或 install.packages("devtools",dependencies = TRUE) 我得到同样的错误:
Error: package or namespace load failed for ‘gert’:
.onLoad failed in loadNamespace() for 'gert', details:
call: NULL
error: 'as_text' is not an exported object from 'namespace:sys'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/ab/usr/my_user/R/x86_64-pc-linux-gnu-library/3.5/gert’
Warning in install.packages :
installation of package ‘gert’ had non-zero exit status
ERROR: dependency ‘gert’ is not available for package ‘usethis’
* removing ‘/ab/usr/my_user/R/x86_64-pc-linux-gnu-library/3.5/usethis’
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
ERROR: dependency ‘usethis’ is not available for package ‘devtools’
* removing ‘/ab/usr/my_user/R/x86_64-pc-linux-gnu-library/3.5/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpj3P5T5/downloaded_packages’
我尝试运行install.packages("gert"),但出现错误:
Error: package or namespace load failed for ‘gert’:
.onLoad failed in loadNamespace() for 'gert', details:
call: NULL
error: 'as_text' is not an exported object from 'namespace:sys'
Error: loading failed
Execution halted
有人有什么想法吗?
这是一些systemInfo():
R 版本 3.5.2 (2018-12-20) 平台:x86_64-pc-linux-gnu(64位)
我查看了评论者/回答者建议关闭和打开 Rstudio 或重新启动 R 会话的类似问题。我已经尝试了这些并得到了同样的错误。
【问题讨论】:
-
你的 r 版本太旧了。可以更新吗?
-
不幸的是,没有。我会调查的,但我不是很有希望。
-
好的。 devtools 引入了一堆包,而这些包也同样如此。其中一个可能不适用于较旧的 r 版本。还有一些软件包有系统要求。
-
您也可以尝试重新安装
sys。坦率地说,我认为关于sys::as_text的错误是一个红鲱鱼,因为它是在 2 年左右之前添加到该包中的,但也许安装被搁置了。 -
使用最新版本的 R 下载自定义 R 安装。现在可以使用