安装 devtools 包失败

问题描述 投票:0回答:3

我正在尝试安装名为 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
3个回答
1
投票

将 R 更新到最新版本有效。


0
投票

安装 libgit2 (按照here的建议)对我有用。

还有一个 conda 包,它也可以工作,以防你没有 sudo 权限。


0
投票

增加一种失败可能性供人们检查:

我的软件包安装突然失败了。经过多次尝试和错误,我意识到这只是描述文件中的一行简单的内容。另外,文件的描述部分在开始新行时需要有 4 个空格制表符。

© www.soinside.com 2019 - 2024. All rights reserved.