简体   繁体   English

无法从 RStudio 中的任何镜像安装软件包; 在 R 中工作

[英]Can't install packages from any mirror in RStudio; works in R

I can install any package from the R executable.我可以从 R 可执行文件安装任何包。 But from RStudio, I get但是从 RStudio,我得到

Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib:
  cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
  unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'

Yes, these are warnings not errors, but nothing is installed anyway.是的,这些是警告而不是错误,但无论如何都没有安装。 I can change the repository eg with我可以更改存储库,例如

install.packages('qgam', dependencies=TRUE, repos='http://cran.rstudio.com/')

or in the RStudio settings, but nothing makes any difference.或在 RStudio 设置中,但没有任何区别。

I have uninstalled R and Rstudio, deleted the Rstudio-desktop folder, deleted all .Renviron files, then reinstalled R and Rstudio.我已经卸载了 R 和 Rstudio,删除了 Rstudio-desktop 文件夹,删除了所有 .Renviron 文件,然后重新安装了 R 和 Rstudio。 I have checked and unchecked "Use internet explorer library" and everything else I can find.我已经选中和取消选中“使用 Internet Explorer 库”以及我能找到的所有其他内容。

.libPaths() gives "C:/Users/User/Documents/R/win-library/3.4" "C:/Program Files/R/R-3.4.3/library" which seems fine, only the first is writeable to Rstudio, but that should be OK? .libPaths() 给出 "C:/Users/User/Documents/R/win-library/3.4" "C:/Program Files/R/R-3.4.3/library" 看起来不错,只有第一个是可写的Rstudio,但那应该没问题吧?

There are no firewalls in operation.没有防火墙在运行。

This is driving me nuts.这让我发疯。

R and Rstudio are up to date, ie R is 3.4.3, Rstudio is 1.1.423 R和Rstudio是最新的,即R是3.4.3,Rstudio是1.1.423

Fixed it.修复。 It was Bitdefender 2018 - not a problem in 2017. I had to add permissions for R and RStudio ("protection" screen, click Features, click the settings gear-wheel in the Firewall section, click "Add rule". And then same again for "Application Access" in the "safe files" section of the Features screen.这是 Bitdefender 2018 - 2017 年没有问题。我必须为 R 和 RStudio 添加权限(“保护”屏幕,单击功能,单击防火墙部分中的设置齿轮,单击“添加规则”。然后再次相同对于“功能”屏幕的“安全文件”部分中的“应用程序访问”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM