devtools::install_git fails to install dependencies of packages in Depends or Imports
我有一个依赖于软件包
1 2 3 4 5 6 | ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'Rttf2pt1' Error : package 'extrafont' could not be loaded ERROR: lazy loading failed for package 'tntpr' * removing 'C:/Users/SFirke/Documents/R/win-library/3.3/tntpr' |
看起来像Extrafont可以很好地安装,但是由于
为什么需要在我的"依赖"列表中放入"
1 2 3 4 5 6 7 | Depends: R (>= 2.15) Imports: extrafontdb, grDevices, utils, Rttf2pt1 |
其他信息
运行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | Installing tntpr Downloading GitHub repo hadley/dplyr@master from URL https://api.github.com/repos/hadley/dplyr/zipball/master Installing dplyr "C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \\ "C:/Users/SFirke/AppData/Local/Temp/RtmpMlRSSR/devtools3dfc4e39620/hadley-dplyr-5902277" --library="C:/Users/SFirke/Documents/R/win-library/3.3" --install-tests * installing *source* package 'dplyr' ... ** libs *** arch - i386 C:/RBuildTools/3.4/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-33~1.2/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"C:/Users/SFirke/Documents/R/win-library/3.3/Rcpp/include" -I"C:/Users/SFirke/Documents/R/win-library/3.3/BH/include" -I"C:/Users/SFirke/Documents/R/win-library/3.3/bindrcpp/include" -I"C:/Users/SFirke/Documents/R/win-library/3.3/plogr/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o <--- lots more lines like this ^^^^^ ---> ** R ** data *** moving datasets to lazyload DB ** inst ** tests ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded *** arch - i386 *** arch - x64 * DONE (dplyr) Installing 1 package: extrafont Installing package into a€?C:/Users/SFirke/Documents/R/win-library/3.3a€? (as a€?liba€? is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/extrafont_0.17.zip' Content type 'application/zip' length 34323 bytes (33 KB) downloaded 33 KB package a€?extrafonta€? successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\\Users\\SFirke\\AppData\\Local\\Temp\ tmpMlRSSR\\downloaded_packages "C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL"C:/Users/SFirke/AppData/Local/Temp/RtmpMlRSSR/file3dfc4a973a21" \\ --library="C:/Users/SFirke/Documents/R/win-library/3.3" --install-tests * installing *source* package 'tntpr' ... ** R ** data *** moving datasets to lazyload DB ** inst ** tests ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'Rttf2pt1' Error : package 'extrafont' could not be loaded ERROR: lazy loading failed for package 'tntpr' * removing 'C:/Users/SFirke/Documents/R/win-library/3.3/tntpr' Error: Command failed (1) |
问题:存在一些特定于Windows的问题,其中devtools 1.12.0(当前的CRAN版本)和devtools 1.12.0.9000的当前开发版本都存在嵌套/递归依赖项的问题(例如,您的程序包A依赖于依赖于软件包C的软件包B; devtools函数
请参阅以下注释:开发版本和该线程的顶部,这些注释也说明了CRAN版本的问题,以及该程序包的手动指定要安装的子依赖项的解决方法。
解决方案:我安装了旧版本的devtools 1.11.1(于2016年4月发布),即使在缺少需要安装的依赖项的情况下,该工具也可用于我的上述
1 2 | install.packages("devtools") # from CRAN devtools::install_version("devtools", version ="1.11.1", repos ="http://cran.us.r-project.org") # get the old version |
然后重新启动R并按预期使用devtools。