devtools install_github安装报错: CAfile: microsoft-r-cacert.pem

本文详细介绍了在R语言中遇到的安装GitHub包失败的问题,错误信息显示为证书验证位置设置错误。提供了具体的解决步骤,包括卸载并重新安装curl和httr包,更新microsoft-r-cacert.pem文件,以及设置正确的pem文件路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错信息

> install_github("dengfei2013/GS")
Installation failed: error setting certificate verify locations:
  CAfile: microsoft-r-cacert.pem
  CApath: none

解决方法

  1. 进入R, 卸载curl, httr, 重新安装
remove.packages(c("curl","httr"))
install.packages(c("curl", "httr"))
  1. 更换microsoft-r-cacert.pem
Sys.setenv(CURL_CA_BUNDLE="/opt/microsoft/ropen/3.5.1/lib64/R/lib/microsoft-r-cacert.pem")

里面是我的路径, 你可以通过locate ,查看你的pem路径, 进行替换

  1. 测试install_github
library(devtools)
install_github("dengfei2013/GS")
> install_github("dengfei2013/GS")    
Downloading GitHub repo dengfei2013/GS@master
from URL https://api.github.com/repos/dengfei2013/GS/zipball/master
Installing GS
'/root/anaconda3/lib/R/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/tmp/RtmpdN5qFa/devtools2bc37ead1356/dengfei2013-GS-f560b6c'  \
  --library='/opt/microsoft/ropen/3.5.1/lib64/R/library' --install-tests 

* installing *source* package ‘GS’ ...
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (GS)

搞定!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值