R包安装失败并出现“ had non-zero exit status”报错解决办法

  • 时间:2025-11-22 21:31 作者: 来源: 阅读:0
  • 扫一扫,手机访问
摘要: 问题描述: R包安装中出现诸如“non-zero exit status”情况的报错信息, 虽然退出R后再library中手动删除R包,但是依旧无法奏效。 笔者参考以下两篇文章问题得以解决。 installation of package ‘blob’ had non-zero exit status R install.packages returns “failed to create lo

问题描述:
R包安装中出现诸如“non-zero exit status”情况的报错信息,
虽然退出R后再library中手动删除R包,但是依旧无法奏效。
笔者参考以下两篇文章问题得以解决。
installation of package ‘blob’ had non-zero exit status
R install.packages returns “failed to create lock directory”

问题报错

install.packages("backports")

There is a binary version available but the source version is later:
binary source needs_compilation
backports  1.1.7  1.1.8              TRUE

installing the source package ‘backports’

试开URL’https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/backports_1.1.8.tar.gz 
Content type  application/x-gzip  length 18047 bytes (17 KB)
downloaded 17 KB

ERROR: failed to lock directory  C:/software/R/R-4.0.2/library  for modifying
Try removing  C:/software/R/R-4.0.2/library/00LOCK-backports 
Warning in install.packages :
installation of package ‘backports’ had non-zero exit status

解决方法:

This happens when your last package installation has interrupted abnormally. to fix this you should remove the locked file. For example Execute this command in R console(删除这个lock的文件):

意思就是上一次安装被异常打断了,为了解决这个问题,必须要手动删除这个locked文件。

unlink("C:/software/R/R-4.0.2/library/00LOCK-backports", recursive = TRUE).
install.packages("backports")
The downloaded source packages are in   ‘C:UsersAdministratorAppDataLocalTempRtmpoX81A2downloaded_packages’

  • 全部评论(0)
最新发布的资讯信息
【系统环境|】八股已死、场景当立(场景篇-设计模式篇)(2025-11-22 23:27)
【系统环境|】群、环、域(2025-11-22 23:26)
【系统环境|】深度解析:基于Python的分布式缓存系统实现与性能优化(2025-11-22 23:26)
【系统环境|】TP区块链下载全解析:从技术原理到代码实现(2025-11-22 23:25)
【系统环境|】大模型在急性肾衰竭预测及临床方案制定中的应用研究(2025-11-22 23:25)
【系统环境|】特价股票投资中的可持续供应链管理整合方法(2025-11-22 23:24)
【系统环境|】第193期 如何微调大语言模型(LLM)(内含源码细节)(2025-11-22 23:23)
【系统环境|】用Python构建智能推荐系统:技术赋能美好生活(2025-11-22 23:23)
【系统环境|】企业估值中的氢能源应用评估(2025-11-22 23:22)
【系统环境|】ansible 学习之路(2025-11-22 23:22)
手机二维码手机访问领取大礼包
返回顶部