R-尝试安装软件包时:InternetOpenUrl失败 [英] R - when trying to install package: InternetOpenUrl failed

查看:914
本文介绍了R-尝试安装软件包时:InternetOpenUrl失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我已经在Win 7中将R(更新到3.2.2)和RStudio(更新到0.99.486),因此下载软件包时遇到了问题.

Since I've updated both R (to 3.2.2) and RStudio (to 0.99.486) in Win 7, I'm experiencing problems downloading packages.

我知道也没有更改CRAN镜像.还已经取消选中工具->全局选项->程序包->使用Internet Explorer库/代理进行HTTP",并且我确保我的Firefox不使用任何代理.

nor changing the CRAN mirror helped. The "Tools -> Global Options -> Packages -> "Use Internet Explorer library/proxy for HTTP" was also already unchecked and I made sure that my Firefox uses no proxy.

我尝试了

setRepositories()

以及使用手动安装软件包

as well as manually installing the package with

install.packages('dplyr', repos='https://cran.uni-muenster.de/')

但我仍然收到消息:

Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  unable to access index for repository https://R-Forge.R-project.org/src/contrib
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  unable to access index for repository https://cran.uni-muenster.de/src/contrib
Installing package into ‘C:/Users/me/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  unable to access index for repository https://cran.uni-muenster.de/src/contrib
Warning in install.packages :
  package ‘dplyr’ is not available (for R version 3.2.2)
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  unable to access index for repository https://cran.uni-muenster.de/bin/windows/contrib/3.2

有人可以帮忙吗?谢谢!

Could anyone please help? Thank you!

推荐答案

问题可能是R所使用的用于下载文件的基础方法无法正确处理https的问题.可以通过尝试来验证

The problem might be a failure to handle https properly by the underlying method used by R for downloading files. This can be verified by trying

fname <- tempfile()
download.file("https://cran.uni-muenster.de/", destfile=fname)
file.remove(fname)

如果这不起作用,但用http替换https确实可行,则最有可能意味着R的download.file使用的方法根本无法处理https或无法验证SSL证书.

If that does not work but replacing https with http does, this most likely means that the method used by R's download.file cannot deal with https at all or fails verifying SSL certificates.

您可以尝试

  • 使用常规http镜像而不是https
  • 更新您的CA证书包以允许正确的证书验证
  • 将默认下载方法设置为"libcurl",看看是否有帮助:

  • using regular http mirrors instead of https
  • update your CA certificate bundle to allow proper certificate validation
  • setting the default download method to "libcurl" and see if that helps:

options(download.file.method="libcurl")

这篇关于R-尝试安装软件包时:InternetOpenUrl失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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