You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

全新安装R后无法从tar.gz源码安装包的问题求助

无法从tar.gz源码安装R包(R4.3.1 + Rtools4.3)

彻底重装R后仍无法通过tar.gz文件安装源码包,同配置的个人笔记本可正常安装,但工作笔记本不行,导致brms、rstan等依赖源码编译的包无法使用。

已执行的操作

  • 彻底卸载原有R/Rtools/RStudio,重新安装R4.3.1
  • 创建可写包存储路径C:/R/library,R已识别该路径:
.libPaths()
[1] "C:/R/library"                       "C:/Program Files/R/R-4.3.1/library"
  • 安装pkgbuild检测Rtools,结果显示正常:
install.packages("pkgbuild")
library(pkgbuild)

rtools_path()
[1] "C:\\rtools43/usr/bin"

has_rtools(debug = TRUE)
Found in Rtools 4.3 installation folder
[1] TRUE

check_rtools(debug = TRUE)
Found in Rtools 4.3 installation folder
[1] TRUE 

错误情况

  1. 尝试安装PKI源码包失败,提示非零退出状态:
install.packages("PKI", type = "source")
Installing package into ‘C:/R/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘base64enc’

trying URL 'https://packages.othr.de/cran/src/contrib/base64enc_0.1-3.tar.gz'
Content type 'text/plain' length 7833 bytes
downloaded 7833 bytes

trying URL 'https://packages.othr.de/cran/src/contrib/PKI_0.1-12.tar.gz'
Content type 'text/plain' length 85544 bytes (83 KB)
downloaded 83 KB


The downloaded source packages are in
        ‘C:\Users\User Name\AppData\Local\Temp\RtmpquNT2s\downloaded_packages’
Warning messages:
1: In install.packages("PKI", type = "source") :
  installation of package ‘base64enc’ had non-zero exit status
2: In install.packages("PKI", type = "source") :
  installation of package ‘PKI’ had non-zero exit status
  1. 手动解压tar.gz到库文件夹后,加载包提示无效:
library(base64enc)
Error in library(base64enc) : 
  ‘base64enc’ is not a valid installed package

会话信息

sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8    LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C                            LC_TIME=English_United Kingdom.utf8    

time zone: Europe/Zurich
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] pkgbuild_1.4.2

loaded via a namespace (and not attached):
[1] processx_3.8.2    compiler_4.3.1    R6_2.5.1          cli_3.6.1         prettyunits_1.1.1 tools_4.3.1       crayon_1.5.2      callr_3.7.3       ps_1.7.5

需要解决此问题,如需更多信息请告知。


内容的提问来源于stack exchange,提问作者KrisAnathema

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 13:50:28