Conda R:devtools :: install_github()在Windows上运行的Ubuntu VM上的软件包失败

时间:2019-05-23 22:24:05

标签: r linux ubuntu devtools

我正在尝试使用install_github软件包中的devtools命令。它可以在Windows 10计算机上正常运行,但无法在Ubuntu VM上运行。

例如,我可以尝试:

install_github("marcusvolz/strava")


Downloading GitHub repo marcusvolz/strava@master
Installing 22 packages: backports, cli, colorspace, digest, dplyr, ggplot2, glue, gtable, lazyeval, mgcv, nlme, pillar, purrr, Rcpp, rlang, scales, sp, stringi, tibble, vctrs, XML, zeallot
backports  (1.1.0   -> 1.1.4    ) [CRAN]
cli        (1.0.1   -> 1.1.0    ) [CRAN]
colorspace (1.3-2   -> 1.4-1    ) [CRAN]
digest     (0.6.15  -> 0.6.19   ) [CRAN]
dplyr      (0.8.0.1 -> 0.8.1    ) [CRAN]
ggplot2    (3.0.0   -> 3.1.1    ) [CRAN]
glue       (1.3.0   -> 1.3.1    ) [CRAN]
gtable     (0.2.0   -> 0.3.0    ) [CRAN]
lazyeval   (0.2.1   -> 0.2.2    ) [CRAN]
mgcv       (1.8-24  -> 1.8-28   ) [CRAN]
nlme       (3.1-137 -> 3.1-140  ) [CRAN]
pillar     (1.3.1   -> 1.4.0    ) [CRAN]
purrr      (0.3.0   -> 0.3.2    ) [CRAN]
Rcpp       (1.0.0   -> 1.0.1    ) [CRAN]
rlang      (0.3.1   -> 0.3.4    ) [CRAN]
scales     (0.5.0   -> 1.0.0    ) [CRAN]
sp         (NA      -> 1.3-1    ) [CRAN]
stringi    (1.3.1   -> 1.4.3    ) [CRAN]
tibble     (2.0.1   -> 2.1.1    ) [CRAN]
vctrs      (NA      -> 0.1.0    ) [CRAN]
XML        (NA      -> 3.98-1.19) [CRAN]
zeallot    (NA      -> 0.1.0    ) [CRAN]
Error in i.p(...): (converted from warning) installation of package ‘backports’ had non-zero exit status
Traceback:

1. install_github("marcusvolz/strava")
2. install_remotes(remotes, auth_token = auth_token, host = host, 
 .     dependencies = dependencies, upgrade = upgrade, force = force, 
 .     quiet = quiet, build = build, build_opts = build_opts, repos = repos, 
 .     type = type, ...)
3. vapply(remotes, install_remote, ..., FUN.VALUE = character(1))
4. FUN(X[[i]], ...)
5. install(source, dependencies = dependencies, upgrade = upgrade, 
 .     force = force, quiet = quiet, build = build, build_opts = build_opts, 
 .     repos = repos, type = type, ...)
6. install_deps(pkgdir, dependencies = dependencies, quiet = quiet, 
 .     build = build, build_opts = build_opts, upgrade = upgrade, 
 .     repos = repos, type = type, ...)
7. update(packages, dependencies = dep_deps, quiet = quiet, upgrade = upgrade, 
 .     build = build, build_opts = build_opts, ...)
8. update.package_deps(packages, dependencies = dep_deps, quiet = quiet, 
 .     upgrade = upgrade, build = build, build_opts = build_opts, 
 .     ...)
9. install_packages(object$package[object$is_cran & behind], repos = attr(object, 
 .     "repos"), type = attr(object, "type"), dependencies = dependencies, 
 .     quiet = quiet, ...)
10. do.call(safe_install_packages, c(list(packages, repos = repos, 
  .     type = type, dependencies = dependencies, quiet = quiet), 
  .     args))
11. (function (...) 
  . {
  .     lib <- paste(.libPaths(), collapse = ":")
  .     if (has_package("crancache") && has_package("callr")) {
  .         i.p <- "crancache" %::% "install_packages"
  .     }
  .     else {
  .         i.p <- utils::install.packages
  .     }
  .     with_envvar(c(R_LIBS = lib, R_LIBS_USER = lib, R_LIBS_SITE = lib), 
  .         if (should_error_for_warnings()) {
  .             with_options(list(warn = 2), with_rprofile_user("options(warn = 2)", 
  .                 i.p(...)))
  .         }
  .         else {
  .             i.p(...)
  .         })
  . })(c("backports", "cli", "colorspace", "digest", "dplyr", "ggplot2", 
  . "glue", "gtable", "lazyeval", "mgcv", "nlme", "pillar", "purrr", 
  . "Rcpp", "rlang", "scales", "sp", "stringi", "tibble", "vctrs", 
  . "XML", "zeallot"), repos = c(CRAN = "http://cran.cnr.berkeley.edu/"), 
  .     type = "source", dependencies = NA, quiet = FALSE)
12. with_envvar(c(R_LIBS = lib, R_LIBS_USER = lib, R_LIBS_SITE = lib), 
  .     if (should_error_for_warnings()) {
  .         with_options(list(warn = 2), with_rprofile_user("options(warn = 2)", 
  .             i.p(...)))
  .     } else {
  .         i.p(...)
  .     })
13. force(code)
14. with_options(list(warn = 2), with_rprofile_user("options(warn = 2)", 
  .     i.p(...)))
15. force(code)
16. with_rprofile_user("options(warn = 2)", i.p(...))
17. with_envvar(c(R_PROFILE_USER = temp_rprofile), {
  .     force(code)
  . })
18. force(code)
19. force(code)
20. i.p(...)
21. warning(gettextf("installation of package %s had non-zero exit status", 
  .     sQuote(update[i, 1L])), domain = NA)
22. .signalSimpleWarning("installation of package ‘backports’ had non-zero exit status", 
  .     quote(i.p(...)))
23. withRestarts({
  .     .Internal(.signalCondition(simpleWarning(msg, call), msg, 
  .         call))
  .     .Internal(.dfltWarn(msg, call))
  . }, muffleWarning = function() NULL)
24. withOneRestart(expr, restarts[[1L]])
25. doWithOneRestart(return(expr), restart)

问题似乎发生在名为backports的软件包中。我尝试从CRAN('http://cran.cnr.berkeley.edu/src/contrib/backports_1.1.4.tar.gz')下载反向端口并从命令行运行R CMD INSTALL backports_1.1.4.tar.gz,但是得到了以下信息:

* installing to library ‘/home/<USER>/anaconda3/lib/R/library’
* installing *source* package ‘backports’ ...
** package ‘backports’ successfully unpacked and MD5 sums checked
** libs
Error in if (nzchar(SHLIB_LIBADD)) SHLIB_LIBADD else character() : 
  argument is of length zero
* removing ‘/home/<USER>/anaconda3/lib/R/library/backports’
* restoring previous ‘/home/<USER>/anaconda3/lib/R/library/backports’

我将Makefile从Windows PC复制粘贴到我的Ubuntu VM,并添加了一个指向SHLIB_LIBADD的路径,我得到了:

* installing to library ‘/home/<USER>/anaconda3/lib/R/library’
* installing *source* package ‘backports’ ...
** package ‘backports’ successfully unpacked and MD5 sums checked
** libs
/usr/bin/gcc  -I"/home/<USER>/anaconda3/lib/R/include" -DNDEBUG          -O3 -Wall  -std=gnu99 -mtune=generic -c dotsElt.c -o dotsElt.o
/usr/bin/gcc  -I"/home/<USER>/anaconda3/lib/R/include" -DNDEBUG          -O3 -Wall  -std=gnu99 -mtune=generic -c dotsLength.c -o dotsLength.o
/usr/bin/gcc  -I"/home/<USER>/anaconda3/lib/R/include" -DNDEBUG          -O3 -Wall  -std=gnu99 -mtune=generic -c init.c -o init.o
/usr/bin/gcc -Wl,--export-all-symbols -shared -o backports.dll dotsElt.o dotsLength.o init.o /home/<USER>/anaconda3/lib/R/lib -L/home/<USER>/anaconda3/lib/R/bin/i386 -lR
/usr/bin/ld: unrecognized option '--export-all-symbols'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
make: *** [/home/<USER>/anaconda3/lib/R/share/make/shlib.mk:6: backports.dll] Error 1
ERROR: compilation failed for package ‘backports’
* removing ‘/home/<USER>/anaconda3/lib/R/library/backports’
* restoring previous ‘/home/<USER>/anaconda3/lib/R/library/backports’

据我所知,backports实际上依赖于Github上的每个R包。它甚至依赖于我自己使用roxygen2构建的程序包,即使我没有说它应该是依赖程序。

关于发生的事情或如何解决的任何想法?

这是我的R.Version()和session_info():

R.version()

$platform
'x86_64-conda_cos6-linux-gnu'
$arch
'x86_64'
$os
'linux-gnu'
$system
'x86_64, linux-gnu'
$status
''
$major
'3'
$minor
'5.1'
$year
'2018'
$month
'07'
$day
'02'
$`svn rev`
'74947'
$language
'R'
$version.string
'R version 3.5.1 (2018-07-02)'
$nickname
'Feather Spray'


session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       Ubuntu 18.04.2 LTS          
 system   x86_64, linux-gnu           
 ui       X11                         
 language en_US                       
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2019-05-23                  

─ Packages ───────────────────────────────────────────────────────────────────
 package       * version date       lib source        
 assertthat      0.2.1   2019-03-21 [1] CRAN (R 3.5.1)
 backports       1.1.0   2017-05-22 [1] CRAN (R 3.5.1)
 base64enc       0.1-3   2015-07-28 [1] CRAN (R 3.5.1)
 callr           2.0.4   2018-05-15 [1] CRAN (R 3.5.1)
 cli             1.0.1   2018-09-25 [1] CRAN (R 3.5.1)
 crayon          1.3.4   2017-09-16 [1] CRAN (R 3.5.1)
 curl            3.2     2018-03-28 [1] CRAN (R 3.5.1)
 data.table      1.12.0  2019-01-13 [1] CRAN (R 3.5.1)
 desc            1.2.0   2018-05-01 [1] CRAN (R 3.5.1)
 devtools      * 2.0.2   2019-04-08 [1] CRAN (R 3.5.1)
 digest          0.6.15  2018-01-28 [1] CRAN (R 3.5.1)
 evaluate        0.13    2019-02-12 [1] CRAN (R 3.5.1)
 fs              1.2.6   2018-08-23 [1] CRAN (R 3.5.1)
 githubinstall * 0.2.2   2018-02-18 [1] CRAN (R 3.5.1)
 glue            1.3.0   2018-07-17 [1] CRAN (R 3.5.1)
 htmltools       0.3.6   2017-04-28 [1] CRAN (R 3.5.1)
 httr            1.3.1   2017-08-20 [1] CRAN (R 3.5.1)
 IRdisplay       0.7.0   2018-11-29 [1] CRAN (R 3.5.1)
 IRkernel        0.8.12  2018-10-02 [1] local         
 jsonlite        1.5     2017-06-01 [1] CRAN (R 3.5.1)
 magrittr        1.5     2014-11-22 [1] CRAN (R 3.5.1)
 memoise         1.1.0   2017-04-21 [1] CRAN (R 3.5.1)
 pbdZMQ          0.3-3   2018-05-05 [1] CRAN (R 3.5.1)
 pkgbuild        1.0.2   2018-10-16 [1] CRAN (R 3.5.1)
 pkgload         1.0.2   2018-10-29 [1] CRAN (R 3.5.1)
 prettyunits     1.0.2   2015-07-13 [1] CRAN (R 3.5.1)
 processx        3.1.0   2018-05-15 [1] CRAN (R 3.5.1)
 R6              2.4.0   2019-02-14 [1] CRAN (R 3.5.1)
 Rcpp            1.0.0   2018-11-07 [1] CRAN (R 3.5.1)
 remotes         2.0.2   2018-10-30 [1] CRAN (R 3.5.1)
 repr            0.19.2  2019-02-06 [1] CRAN (R 3.5.1)
 rlang           0.3.1   2019-01-08 [1] CRAN (R 3.5.1)
 rprojroot       1.3-2   2018-01-03 [1] CRAN (R 3.5.1)
 sessioninfo     1.1.1   2018-11-05 [1] CRAN (R 3.5.1)
 testthat        2.0.0   2017-12-13 [1] CRAN (R 3.5.1)
 usethis       * 1.4.0   2018-08-14 [1] CRAN (R 3.5.1)
 uuid            0.1-2   2015-07-28 [1] CRAN (R 3.5.1)
 withr           2.1.2   2018-03-15 [1] CRAN (R 3.5.1)

[1] /home/<USER>/anaconda3/lib/R/library


0 个答案:

没有答案