R 更新后无法安装软件包:无法访问存储库的索引:无法加载 Internet 例程 [英] Unable to install packages after R update: unable to access index for repository: internet routines cannot be loaded

查看:310
本文介绍了R 更新后无法安装软件包:无法访问存储库的索引:无法加载 Internet 例程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 RStudio,我昨天将 R 更新为以下版本:

I use RStudio, and I updated R yesterday to the following version:

R version 4.0.0 (2020-04-24) -- "Arbor Day"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

现在,我无法连接到任何 CRAN 镜像(我已经尝试了 4 个不同的镜像)或安装软件包.当我启动 RStudio 时,我在启动时收到以下错误:

Now, I can't connect to any CRAN mirrors (I've tried 4 different ones) or install packages. When I start RStudio, I get the following errors on start up:

Error in tools::startDynamicHelp() : internet routines cannot be loaded
Warning: namespace ‘lme4’ is not available and has been replaced
by .GlobalEnv when processing object ‘lmer1’
Warning: namespace ‘ggplot2’ is not available and has been replaced
by .GlobalEnv when processing object ‘plot1’
Warning: namespace ‘emmeans’ is not available and has been replaced
by .GlobalEnv when processing object ‘.Last.ref_grid’
Warning: namespace ‘pbkrtest’ is not available and has been replaced
by .GlobalEnv when processing object ‘.Last.ref_grid’
[Workspace loaded from C:/Users/xxx.RData]

Loading required package: lmerTest
Loading required package: lme4
Loading required package: Matrix
Error: package or namespace load failed for ‘lme4’:
 package ‘lme4’ was installed before R 4.0.0: please re-install it
Failed with error:  ‘package ‘lme4’ could not be loaded’

然后,当我尝试安装软件包时,收到以下消息:

Then, when I try to install a package, I get the following message:

Installing package into ‘C:/Users/xxx/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib:
  internet routines cannot be loaded
Warning in install.packages :
  package ‘Rtools’ is not available (for R version 4.0.0)
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.0:
  internet routines cannot be loaded

我知道这些警告有多个线程,但我还没有在其中任何一个中找到解决此问题的方法.我已经尝试过但没有奏效的事情:

I know there are multiple threads on these warnings, but I haven't found a solution to this problem on any of them. Things I've tried already that haven't worked:

  • 更改 CRAN 镜像设置 - 我尝试了 4 种不同的镜像设置,镜像正常工作,因为它可以在另一台计算机上运行
  • 重新启动程序
  • 重新启动计算机
  • 更改工具>全局选项>包中的设置,以取消选中 https
  • 更新 RStudio(虽然这也是 R 中的一个问题)
  • 卸载并重新安装 R 4.0
  • 检查库路径 - 似乎正确
  • 使 Internet Explorer 成为默认浏览器
  • 运行命令 options(repos='https://cran.rstudio.com/')
  • 运行命令行 install.packages("package name", dependencies=TRUE, repos='http://cran.rstudio.com/')
  • 运行命令 options(download.file.method="libcurl")
  • 运行命令Sys.getenv("LD_LIBRARY_PATH")

我的合作伙伴将 R 4.0 和 RStudio 下载到他的计算机上,并且运行良好.

My partner downloaded R 4.0 and RStudio on to his computer and it works fine.

有什么建议吗?我是 Stack Overflow 的新手,也是 R 的新手,所以请尽可能提供分步说明/建议!

Any suggestions? I'm new to Stack Overflow and pretty new to R, so please, step by step instructions/suggestions where possible!

推荐答案

因此,经过 4 个电话和多次尝试解决此问题后,我所在机构的 IT 部门今天能够禁用阻止 R 和 R Studio 的防病毒块从工作.

So, after 4 phone calls and multiple attempts at fixing this problem, my institutional IT department were today able to disable the antivirus block that was preventing R and R Studio from working.

显然,为了避免将来发生这种情况,我需要从特定文件夹运行新程序.所以它毕竟是防病毒软件,但我无法更改设置,因为我有一台工作计算机.

Apparently, to avoid this in the future, I need to run new programs from a specific folder. So it was the antivirus after all, but I couldn't change the settings from my end as I have a work computer.

这篇关于R 更新后无法安装软件包:无法访问存储库的索引:无法加载 Internet 例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆