无法在 jupyter 中为 r 内核安装 tidyverse 包

问题描述

我最近使用 conda install -c r r-irkernel 安装了 Anaconda启用了 r 内核,我参考了:https://kyleake.medium.com/how-to-install-r-in-jupyter-with-irkernel-in-3-steps-917519326e41

现在从 jupyter notebook 开始,当我尝试安装 tidyverse 软件包时,我收到有关 jsonlite 的错误:

Warning message:
"package 'tidyverse' was built under R version 3.6.3"
Error: package or namespace load failed for 'tidyverse' in loadNamespace(j <- i[[1L]],c(lib.loc,.libPaths()),versionCheck = vI[[j]]):
 namespace 'jsonlite' 1.6 is already loaded,but >= 1.7.2 is required
Traceback:

1. library("tidyverse")
2. tryCatch({
 .     attr(package,"LibPath") <- which.lib.loc
 .     ns <- loadNamespace(package,lib.loc)
 .     env <- attachNamespace(ns,pos = pos,deps,exclude,include.only)
 . },error = function(e) {
 .     P <- if (!is.null(cc <- conditionCall(e))) 
 .         paste(" in",deparse(cc)[1L])
 .     else ""
 .     msg <- gettextf("package or namespace load failed for %s%s:\n %s",.         sQuote(package),P,conditionMessage(e))
 .     if (logical.return) 
 .         message(paste("Error:",msg),domain = NA)
 .     else stop(msg,call. = FALSE,domain = NA)
 . })
3. tryCatchList(expr,classes,parentenv,handlers)
4. tryCatchOne(expr,names,handlers[[1L]])
5. value[[3L]](cond)
6. stop(msg,domain = NA)

似乎 jsonlite' 1.6 is already loaded,but >= 1.7.2 is required 是问题所在,所以当我尝试手动安装 jsonlite 时,我遇到了这个问题:

install.packages("jsonlite")


package 'jsonlite' successfully unpacked and MD5 sums checked
Warning message:
"cannot remove prior installation of package 'jsonlite'"Warning message in file.copy(savedcopy,lib,recursive = TRUE):
"problem copying C:\ProgramData\Anaconda3\Lib\R\library\00LOCK\jsonlite\libs\x64\jsonlite.dll to C:\ProgramData\Anaconda3\Lib\R\library\jsonlite\libs\x64\jsonlite.dll: Permission denied"Warning message:
"restored 'jsonlite'"

The downloaded binary packages are in
    C:\Users\viny\AppData\Local\Temp\RtmpADyCWE\downloaded_packages

那么我如何在 tidyverse package 中安装 jupyter notebook

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)