简体   繁体   English

R无法从github下载websockets包

[英]R cannot download websockets package from the github

The manual is written here: https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/R手册写在这里: https : //github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/R

The mentioned code is written in Section 2 of Install libraries Problems are with this part提到的代码写在安装库的第 2 节 问题与这部分有关

library(devtools)
install_github("brettjbush/R-Websockets")

With R and RTools versions above 4.0 I have following error.对于 4.0 以上的 R 和 RTools 版本,我有以下错误。

> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets@HEAD
Installing 1 packages: caTools
Installing package into ‘\\energia.sise/dfs/REDIRECT/german.suhharukov/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/caTools_1.18.0.zip'
Content type 'application/zip' length 317292 bytes (309 KB)
downloaded 309 KB

package ‘caTools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\german.suhharukov\AppData\Local\Temp\RtmpoRYGc0\downloaded_packages
√  checking for file 'C:\Users\german.suhharukov\AppData\Local\Temp\RtmpoRYGc0\remotes1aa03e212c08\brettjbush-R-Websockets-fc7ee9c/DESCRIPTION' (1s)
-  preparing 'websockets':
√  checking DESCRIPTION meta-information ... 
-  cleaning src
   Warning in system2(command, args, stdout = NULL, stderr = NULL, ...) :
     'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "C:/PROGRA~1/R/R-40~1.3/share/make/clean.mk" -f Makevars.win clean'
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'websockets_1.1.7.tar.gz'
   
Installing package into ‘\\sise/dfs/REDIRECT/MYNAME/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
'\\sise\dfs\REDIRECT\MYNAME\Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
* installing *source* package 'websockets' ...
** using staged installation
** libs

*** arch - i386
Error in system(cmd) : 
  (converted from warning) 'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "Makevars.win" -f "C:/PROGRA~1/R/R-40~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-40~1.3/share/make/winshlib.mk" SHLIB="websockets.dll" OBJECTS="libsock.o"'
* removing '\\sise/dfs/REDIRECT/MYNAME/Documents/R/win-library/4.0/websockets'
Error: Failed to install 'websockets' from GitHub:
  (converted from warning) installation of package ‘C:/Users/MYNAME/AppData/Local/Temp/RtmpoRYGc0/file1aa0518554ea/websockets_1.1.7.tar.gz’ had non-zero exit status
> install.packages("caTools")
Installing package into ‘\\sise/dfs/REDIRECT/MYNAME/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/caTools_1.18.0.zip'
Content type 'application/zip' length 317292 bytes (309 KB)
downloaded 309 KB

package ‘caTools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\MYNAME\AppData\Local\Temp\XXXXXXX\downloaded_packages
> 

Errors are following错误如下


> library(devtools)
Loading required package: usethis
> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets@master
trying URL 'https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe'
Content type 'application/x-msdownload' length 108622512 bytes (103.6 MB)
downloaded 103.6 MB

Error: Failed to install 'websockets' from GitHub:
  Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
> pkgbuild::check_build_tools(debug = TRUE)
trying URL 'https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe'
Content type 'application/x-msdownload' length 108622512 bytes (103.6 MB)
downloaded 103.6 MB

Error: Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.

> find_rtools()
[1] TRUE
> Sys.which("ls.exe")
                   ls.exe 
"C:\\Rtools\\bin\\ls.exe"

How can I download this package?我怎样才能下载这个包?

In the notes on github it says "NOTE: This package is no longer maintained. For implementing websocket servers in R, try the httpuv package"在 github 上的注释中说“注意:此包不再维护。要在 R 中实现 websocket 服务器,请尝试使用 httpuv 包”

Another possible problem could be that you are running a new version of R with an old version of Rtools.另一个可能的问题可能是您正在使用旧版本的 Rtools 运行新版本的 R。 So I'd try to install the newest version of Rtools or run an older version of R with a compatible version of Rtools, such that you can build and compile the package.因此,我会尝试安装最新版本的 Rtools 或使用兼容版本的 Rtools 运行旧版本的 R,以便您可以构建和编译包。

I ran your code on my machine running R 4.0.2 and Rtools 4.0.0 and did not face any issues installing the package.我在运行 R 4.0.2 和 Rtools 4.0.0 的机器上运行了您的代码,并且在安装该软件包时没有遇到任何问题。 So I'd suggest installinng the newest version of R and Rtools from here: https://cran.r-project.org/bin/windows/Rtools/ and trying again.所以我建议从这里安装最新版本的 R 和 Rtools: https ://cran.r-project.org/bin/windows/Rtools/ 然后再试一次。

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

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