简体   繁体   English

R devtools :: install_github()下载错误:未经授权

[英]R devtools::install_github() error in download: unauthorized

I'm trying to tie R to Twitter and everything I try has been failing. 我正在尝试将R绑定到Twitter,而我尝试的一切都失败了。 I've been looking at several links including the following: One , Two , Three 我一直在寻找几个链接,包括以下内容:

While those have led to more issues, I'm now looking at the links here and here to try some workarounds. 虽然这些问题导致了更多问题,但我现在在这里这里查看链接,以尝试一些解决方法。 I would have posted my question as a comment to either of these links but I don't have enough rep yet. 我会将我的问题发布为对这些链接中任何一个的评论,但我没有足够的代表。

When I run the following code, I get the following error 当我运行以下代码时,出现以下错误

Code: 码:

library(base64enc)
library(RCurl)
library(httr)
set_config( config( ssl_verifypeer = 0L ) )
devtools::install_github("jrowen/twitteR", user="MY_USERNAME", password="MY_PASSWORD", ref = "oauth_httr_1_0")

Error: 错误:

WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools 3.3 from http://cran.r-project.org/bin/windows/Rtools/ and then run find_rtools().
Downloading GitHub repo jrowen/twitteR@oauth_httr_1_0
Error in download(dest, src, auth) : client error: (401) Unauthorized

Am I just completely missing something here in how to download this dev twitteR package? 我是否在这里完全缺少有关如何下载此dev twitteR软件包的信息? Does anyone have an idea on how to get past the 401 error? 有谁知道如何克服401错误?

Thanks, 谢谢,

Have you installed and sourced R tools in the session you are referencing above? 您是否在上面引用的会话中安装了R工具并提供了源代码? You aren't getting a certificate error (were you before?) which suggests you don't have a certificate server you're running under as was the issue in some of your linked posts. 您没有收到证书错误(您以前曾来过吗?),这表明您没有正在运行的证书服务器,就像某些链接文章中的问题一样。

I would suggest the following steps to find your issue. 我建议按照以下步骤查找您的问题。

You may need the httpuv package which can be downloaded sourced with 您可能需要httpuv软件包,该软件包可通过以下来源下载

install.packages('httpuv')
library('httpuv')

Sometimes the twitteR package needs an older version of httr to work correctly, depending on jrowen's (and hadley's) updates. 有时,twitteR软件包需要较旧版本的httr才能正常工作,具体取决于jrowen(和hadley)的更新。

You may try installing the older version of httr 您可以尝试安装旧版的httr

 devtools::install_version("httr", version="0.6.0", repos="http://cran.us.r-project.org")

and restarting R and then trying your install again. 然后重新启动R,然后再次尝试安装。 Note that if you are on a 64-bit machine, you will probably have to install the most recent version of httr first, then install the older version. 请注意,如果您使用的是64位计算机,则可能必须先安装httr的最新版本,然后再安装较旧的版本。

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

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