【问题标题】:Error installing packages from github从 github 安装包时出错
【发布时间】:2013-05-24 17:09:49
【问题描述】:

我无法从 github 安装包:

> install_github('cranvas', 'ggobi', args="--no-multiarch")
Installing github repo(s) cranvas/master from ggobi
Installing cranvas.zip from https://github.com/ggobi/cranvas/archive/master.zip
Error in function (type, msg, asError = TRUE)  : couldn't connect to host

这是我的会议:

R version 3.0.1 (2013-05-16)
Platform: x86_64-pc-linux-gnu (64-bit)

注意:install.packages 照常工作,只是 github 的问题。你们中的一些人曾经遇到过这种情况吗?谢谢

【问题讨论】:

  • 您是否使用/隐藏了一些代理?检查是否可以使用浏览器或wget https://github.com/ggobi/cranvas/archive/master.zip 下载
  • 是的,我可以确认终端无法获取 url。我认为这不是问题,因为我可以使用从 cran 安装,而且我还可以从 mozilla 下载 master.zip(然后解压缩并重新压缩为 tar.gz 进行安装)。
  • install_url("http://github.com/ggobi/cranvas/archive/master.zip", "cranvas") 呢?
  • @Salem 不幸的结果相同
  • @Hadley 我也遇到了同样的错误。我四处寻找并尝试了很多东西,包括GIT_SSL_NO_VERIFY,但到目前为止还没有运气。有任何想法吗?谢谢。

标签: r github


【解决方案1】:

我遇到了同样的问题,我用了这个,它对我有用

    library(downloader)
    download("https://github.com/ropensci/plotly/archive/master.tar.gz", "plotly.tar.gz")
    install.packages("plotly.tar.gz", repos = NULL, type = "source")

【讨论】:

    【解决方案2】:

    来自:http://healthvis.org/install/

    一些用户在使用上述说明时遇到以下错误:函数错误(类型,msg,asError = TRUE):无法连接到主机。这可能是由于使用了代理(这会阻止您从 github 安装任何包),并且可以使用 httr 包进行纠正。在上面的 install_github(...) 之前运行以下命令:

    install.packages("httr")
    library(devtools)
    library(httr)
    set_config(use_proxy(url="http://proxyname.company.com",port=8080,username="XXX",password="XXX")) 
    install_github("cranvas")
    

    希望这会有所帮助。

    【讨论】:

    • 抱歉耽搁了。感谢您的回答。
    【解决方案3】:

    GitHub 不再支持 HTTP。这在几年前就被禁用了,它可能与mitigation of FireSheep 保持一致。我的测试如下:

    curl -i http://github.com/ggobi/cranvas/archive/master.zip
    HTTP/1.1 301 Moved Permanently
    Server: GitHub.com
    Date: Mon, 26 Aug 2013 03:15:17 GMT
    Content-Type: text/html
    Content-Length: 178
    Connection: close
    Location: https://github.com/ggobi/cranvas/archive/master.zip
    Vary: Accept-Encoding
    
    <html>
    <head><title>301 Moved Permanently</title></head>
    <body bgcolor="white">
    <center><h1>301 Moved Permanently</h1></center>
    <hr><center>nginx</center>
    </body>
    </html>
    

    注意 301 和 HTTPS 作为替换 URL。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-15
      相关资源
      最近更新 更多